PERFORCE change 105943 for review
Tom Rhodes
trhodes at FreeBSD.org
Sun Sep 10 11:41:41 PDT 2006
http://perforce.freebsd.org/chv.cgi?CH=105943
Change 105943 by trhodes at trhodes_local on 2006/09/10 18:40:23
More diff reduction: Fix __FBSDID, add/modify comments,
add parens, space fixes, etc.
Affected files ...
.. //depot/projects/usb/src/sys/dev/usb/if_cue.c#7 edit
.. //depot/projects/usb/src/sys/dev/usb/if_kue.c#7 edit
Differences ...
==== //depot/projects/usb/src/sys/dev/usb/if_cue.c#7 (text+ko) ====
@@ -30,6 +30,9 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD: src/sys/dev/usb/if_cue.c,v 1.63 2006/09/07 00:06:41 imp Exp $");
+
/*
* CATC USB-EL1210A USB to ethernet driver. Used in the CATC Netmate
* adapters and others.
@@ -53,7 +56,6 @@
* be called from within the config thread function !
*/
-#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/sockio.h>
@@ -84,8 +86,6 @@
#include <dev/usb/if_cuereg.h>
-__FBSDID("$FreeBSD: src/sys/dev/usb/if_cue.c,v 1.61 2005/11/11 16:04:55 ru Exp $");
-
/*
* Various supported device vendors/products.
*/
@@ -121,8 +121,8 @@
static void
cue_cfg_getmac(struct cue_softc *sc, void *buf);
-static u_int32_t
-cue_mchash(const u_int8_t *addr);
+static uint32_t
+cue_mchash(const uint8_t *addr);
static void
cue_cfg_promisc_upd(struct cue_softc *sc,
@@ -358,10 +358,10 @@
#define CUE_BITS 9
-static u_int32_t
-cue_mchash(const u_int8_t *addr)
+static uint32_t
+cue_mchash(const uint8_t *addr)
{
- u_int32_t crc;
+ uint32_t crc;
/* Compute CRC for the address value. */
crc = ether_crc32_le(addr, ETHER_ADDR_LEN);
@@ -471,7 +471,7 @@
struct cue_type *t;
if (uaa->iface != NULL) {
- return UMATCH_NONE;
+ return(UMATCH_NONE);
}
t = cue_devs;
@@ -869,8 +869,8 @@
m, 0, m->m_pkthdr.len);
/*
- * if there's a BPF listener, bounce a copy
- * of this frame to him:
+ * If there's a BPF listener, bounce a copy of this frame
+ * to him.
*/
BPF_MTAP(ifp, m);
@@ -919,7 +919,7 @@
}
/*
- * Cancel pending I/O
+ * Cancel pending I/O and free all RX/TX buffers.
*/
cue_cfg_stop(sc, cc, 0);
#if 0
@@ -934,7 +934,7 @@
/* Enable RX logic. */
cue_cfg_csr_write_1(sc, CUE_ETHCTL, CUE_ETHCTL_RX_ON|CUE_ETHCTL_MCAST_ON);
- /* load the multicast filter */
+ /* Load the multicast filter */
cue_cfg_promisc_upd(sc, cc, 0);
/*
@@ -992,13 +992,13 @@
break;
default:
- error = ether_ioctl(ifp, command, data);
- break;
+ error = ether_ioctl(ifp, command, data);
+ break;
}
mtx_unlock(&(sc->sc_mtx));
- return error;
+ return(error);
}
static void
@@ -1018,6 +1018,10 @@
return;
}
+/*
+ * Stop the adapter and free any mbufs allocated to the
+ * RX and TX lists.
+ */
static void
cue_cfg_stop(struct cue_softc *sc,
struct cue_config_copy *cc, u_int16_t refcount)
==== //depot/projects/usb/src/sys/dev/usb/if_kue.c#7 (text+ko) ====
@@ -30,6 +30,9 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD: src/sys/dev/usb/if_kue.c,v 1.70 2006/09/07 00:06:41 imp Exp $");
+
/*
* Kawasaki LSI KL5KUSB101B USB to ethernet adapter driver.
*
@@ -67,7 +70,6 @@
* be called from within the config thread function !
*/
-#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/sockio.h>
@@ -81,6 +83,7 @@
#include <net/if_arp.h>
#include <net/ethernet.h>
#include <net/if_dl.h>
+#include <net/if_media.h>
#include <net/if_types.h>
#include <net/bpf.h>
@@ -98,8 +101,6 @@
#include <dev/usb/if_kuereg.h>
#include <dev/usb/if_kuefw.h>
-__FBSDID("$FreeBSD: src/sys/dev/usb/if_kue.c,v 1.68 2005/11/11 16:04:55 ru Exp $");
-
/*
* Various supported device vendors/products.
*/
@@ -125,8 +126,6 @@
{ 0, 0 }
};
-/* prototypes */
-
static device_probe_t kue_probe;
static device_attach_t kue_attach;
static device_detach_t kue_detach;
@@ -272,7 +271,7 @@
void *data)
{
u_int16_t length;
- usbd_status err;
+ usbd_status err;
if (usbd_config_td_is_gone(&(sc->sc_config_td))) {
goto error;
@@ -496,7 +495,7 @@
struct kue_type *t;
if (uaa->iface != NULL) {
- return UMATCH_NONE;
+ return(UMATCH_NONE);
}
t = kue_devs;
@@ -507,7 +506,7 @@
}
t++;
}
- return UMATCH_NONE;
+ return(UMATCH_NONE);
}
/*
@@ -674,6 +673,10 @@
return 0;
}
+/*
+ * A frame has been uploaded: pass the resulting mbuf chain up to
+ * the higher level protocols.
+ */
static void
kue_bulk_read_clear_stall_callback(struct usbd_xfer *xfer)
{
@@ -868,7 +871,7 @@
ifp->if_drv_flags |= IFF_DRV_OACTIVE;
done:
- return;
+ return(0);
}
static void
@@ -961,8 +964,8 @@
static int
kue_ioctl_cb(struct ifnet *ifp, u_long command, caddr_t data)
{
- struct kue_softc * sc = ifp->if_softc;
- int error = 0;
+ struct kue_softc *sc = ifp->if_softc;
+ int error = 0;
mtx_lock(&(sc->sc_mtx));
@@ -1019,6 +1022,10 @@
return;
}
+/*
+ * Stop the adapter and free any mbufs allocated to the
+ * RX and TX lists.
+ */
static void
kue_watchdog(void *arg)
{
More information about the p4-projects
mailing list