summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/net
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/usb/net')
-rw-r--r--sys/dev/usb/net/if_aue.c4
-rw-r--r--sys/dev/usb/net/if_axe.c4
-rw-r--r--sys/dev/usb/net/if_cdce.c24
-rw-r--r--sys/dev/usb/net/if_cue.c2
-rw-r--r--sys/dev/usb/net/if_ipheth.c2
-rw-r--r--sys/dev/usb/net/if_kue.c2
-rw-r--r--sys/dev/usb/net/if_rue.c2
-rw-r--r--sys/dev/usb/net/if_udav.c2
-rw-r--r--sys/dev/usb/net/if_usie.c2
-rw-r--r--sys/dev/usb/net/ruephy.c6
-rw-r--r--sys/dev/usb/net/uhso.c8
11 files changed, 30 insertions, 28 deletions
diff --git a/sys/dev/usb/net/if_aue.c b/sys/dev/usb/net/if_aue.c
index fdee6b7..33ed236 100644
--- a/sys/dev/usb/net/if_aue.c
+++ b/sys/dev/usb/net/if_aue.c
@@ -740,7 +740,7 @@ aue_intr_callback(struct usb_xfer *xfer, usb_error_t error)
case USB_ST_TRANSFERRED:
if ((ifp->if_drv_flags & IFF_DRV_RUNNING) &&
- actlen >= sizeof(pkt)) {
+ actlen >= (int)sizeof(pkt)) {
pc = usbd_xfer_get_frame(xfer, 0);
usbd_copy_out(pc, 0, &pkt, sizeof(pkt));
@@ -793,7 +793,7 @@ aue_bulk_read_callback(struct usb_xfer *xfer, usb_error_t error)
}
} else {
- if (actlen <= sizeof(stat) + ETHER_CRC_LEN) {
+ if (actlen <= (int)(sizeof(stat) + ETHER_CRC_LEN)) {
ifp->if_ierrors++;
goto tr_setup;
}
diff --git a/sys/dev/usb/net/if_axe.c b/sys/dev/usb/net/if_axe.c
index 02bb358..2f9929f 100644
--- a/sys/dev/usb/net/if_axe.c
+++ b/sys/dev/usb/net/if_axe.c
@@ -1037,7 +1037,7 @@ axe_rx_frame(struct usb_ether *ue, struct usb_page_cache *pc, int actlen)
error = 0;
if ((sc->sc_flags & AXE_FLAG_STD_FRAME) != 0) {
while (pos < actlen) {
- if ((pos + sizeof(hdr)) > actlen) {
+ if ((int)(pos + sizeof(hdr)) > actlen) {
/* too little data */
error = EINVAL;
break;
@@ -1061,7 +1061,7 @@ axe_rx_frame(struct usb_ether *ue, struct usb_page_cache *pc, int actlen)
}
} else if ((sc->sc_flags & AXE_FLAG_CSUM_FRAME) != 0) {
while (pos < actlen) {
- if ((pos + sizeof(csum_hdr)) > actlen) {
+ if ((int)(pos + sizeof(csum_hdr)) > actlen) {
/* too little data */
error = EINVAL;
break;
diff --git a/sys/dev/usb/net/if_cdce.c b/sys/dev/usb/net/if_cdce.c
index eabf9c6..780efe8 100644
--- a/sys/dev/usb/net/if_cdce.c
+++ b/sys/dev/usb/net/if_cdce.c
@@ -303,8 +303,8 @@ cdce_ncm_init(struct cdce_softc *sc)
int err;
ufd = usbd_find_descriptor(sc->sc_ue.ue_udev, NULL,
- sc->sc_ifaces_index[1], UDESC_CS_INTERFACE, 0 - 1,
- UCDC_NCM_FUNC_DESC_SUBTYPE, 0 - 1);
+ sc->sc_ifaces_index[1], UDESC_CS_INTERFACE, 0xFF,
+ UCDC_NCM_FUNC_DESC_SUBTYPE, 0xFF);
/* verify length of NCM functional descriptor */
if (ufd != NULL) {
@@ -514,7 +514,7 @@ cdce_attach(device_t dev)
ud = usbd_find_descriptor
(uaa->device, NULL, uaa->info.bIfaceIndex,
- UDESC_CS_INTERFACE, 0 - 1, UDESCSUB_CDC_UNION, 0 - 1);
+ UDESC_CS_INTERFACE, 0xFF, UDESCSUB_CDC_UNION, 0xFF);
if ((ud == NULL) || (ud->bLength < sizeof(*ud)) ||
(sc->sc_flags & CDCE_FLAG_NO_UNION)) {
@@ -598,7 +598,7 @@ alloc_transfers:
ued = usbd_find_descriptor
(uaa->device, NULL, uaa->info.bIfaceIndex,
- UDESC_CS_INTERFACE, 0 - 1, UDESCSUB_CDC_ENF, 0 - 1);
+ UDESC_CS_INTERFACE, 0xFF, UDESCSUB_CDC_ENF, 0xFF);
if ((ued == NULL) || (ued->bLength < sizeof(*ued))) {
error = USB_ERR_INVAL;
@@ -892,7 +892,9 @@ cdce_bulk_read_callback(struct usb_xfer *xfer, usb_error_t error)
struct cdce_softc *sc = usbd_xfer_softc(xfer);
struct mbuf *m;
uint8_t x;
- int actlen, aframes, len;
+ int actlen;
+ int aframes;
+ int len;
usbd_xfer_status(xfer, &actlen, NULL, &aframes, NULL);
@@ -911,7 +913,7 @@ cdce_bulk_read_callback(struct usb_xfer *xfer, usb_error_t error)
if ((sc->sc_flags & CDCE_FLAG_ZAURUS) && len >= 14)
len -= 4;
- if (len < sizeof(struct ether_header)) {
+ if (len < (int)sizeof(struct ether_header)) {
m_freem(m);
continue;
}
@@ -1096,7 +1098,7 @@ cdce_ncm_fill_tx_frames(struct usb_xfer *xfer, uint8_t index)
break;
}
- if (m->m_pkthdr.len > rem) {
+ if (m->m_pkthdr.len > (int)rem) {
if (n == 0) {
/* The frame won't fit in our buffer */
DPRINTFN(1, "Frame too big to be transmitted!\n");
@@ -1278,7 +1280,7 @@ cdce_ncm_bulk_read_callback(struct usb_xfer *xfer, usb_error_t error)
DPRINTFN(1, "received %u bytes in %u frames\n",
actlen, aframes);
- if (actlen < (sizeof(sc->sc_ncm.hdr) +
+ if (actlen < (int)(sizeof(sc->sc_ncm.hdr) +
sizeof(sc->sc_ncm.dpt))) {
DPRINTFN(1, "frame too short\n");
goto tr_setup;
@@ -1305,7 +1307,7 @@ cdce_ncm_bulk_read_callback(struct usb_xfer *xfer, usb_error_t error)
goto tr_stall;
}
temp = UGETW(sc->sc_ncm.hdr.wDptIndex);
- if ((temp + sizeof(sc->sc_ncm.dpt)) > actlen) {
+ if ((int)(temp + sizeof(sc->sc_ncm.dpt)) > actlen) {
DPRINTFN(1, "invalid DPT index: 0x%04x\n", temp);
goto tr_stall;
}
@@ -1354,7 +1356,7 @@ cdce_ncm_bulk_read_callback(struct usb_xfer *xfer, usb_error_t error)
temp = UGETW(sc->sc_ncm.dp[x].wFrameLength);
if ((offset == 0) ||
- (temp < sizeof(struct ether_header)) ||
+ (temp < (int)sizeof(struct ether_header)) ||
(temp > (MCLBYTES - ETHER_ALIGN))) {
DPRINTFN(1, "NULL frame detected at %d\n", x);
m = NULL;
@@ -1366,7 +1368,7 @@ cdce_ncm_bulk_read_callback(struct usb_xfer *xfer, usb_error_t error)
m = NULL;
/* silently ignore this frame */
continue;
- } else if (temp > (MHLEN - ETHER_ALIGN)) {
+ } else if (temp > (int)(MHLEN - ETHER_ALIGN)) {
m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR);
} else {
m = m_gethdr(M_DONTWAIT, MT_DATA);
diff --git a/sys/dev/usb/net/if_cue.c b/sys/dev/usb/net/if_cue.c
index 7466ba9..30c5247a 100644
--- a/sys/dev/usb/net/if_cue.c
+++ b/sys/dev/usb/net/if_cue.c
@@ -457,7 +457,7 @@ cue_bulk_read_callback(struct usb_xfer *xfer, usb_error_t error)
switch (USB_GET_STATE(xfer)) {
case USB_ST_TRANSFERRED:
- if (actlen <= (2 + sizeof(struct ether_header))) {
+ if (actlen <= (int)(2 + sizeof(struct ether_header))) {
ifp->if_ierrors++;
goto tr_setup;
}
diff --git a/sys/dev/usb/net/if_ipheth.c b/sys/dev/usb/net/if_ipheth.c
index ad4b6f1..21db100 100644
--- a/sys/dev/usb/net/if_ipheth.c
+++ b/sys/dev/usb/net/if_ipheth.c
@@ -471,7 +471,7 @@ ipheth_bulk_read_callback(struct usb_xfer *xfer, usb_error_t error)
sc->sc_rx_buf[x] = NULL;
len = usbd_xfer_frame_len(xfer, x);
- if (len < (sizeof(struct ether_header) +
+ if (len < (int)(sizeof(struct ether_header) +
IPHETH_RX_ADJ)) {
m_freem(m);
continue;
diff --git a/sys/dev/usb/net/if_kue.c b/sys/dev/usb/net/if_kue.c
index 2d3fc42..791c73a 100644
--- a/sys/dev/usb/net/if_kue.c
+++ b/sys/dev/usb/net/if_kue.c
@@ -545,7 +545,7 @@ kue_bulk_read_callback(struct usb_xfer *xfer, usb_error_t error)
switch (USB_GET_STATE(xfer)) {
case USB_ST_TRANSFERRED:
- if (actlen <= (2 + sizeof(struct ether_header))) {
+ if (actlen <= (int)(2 + sizeof(struct ether_header))) {
ifp->if_ierrors++;
goto tr_setup;
}
diff --git a/sys/dev/usb/net/if_rue.c b/sys/dev/usb/net/if_rue.c
index a870676..894e368 100644
--- a/sys/dev/usb/net/if_rue.c
+++ b/sys/dev/usb/net/if_rue.c
@@ -638,7 +638,7 @@ rue_intr_callback(struct usb_xfer *xfer, usb_error_t error)
case USB_ST_TRANSFERRED:
if (ifp && (ifp->if_drv_flags & IFF_DRV_RUNNING) &&
- actlen >= sizeof(pkt)) {
+ actlen >= (int)sizeof(pkt)) {
pc = usbd_xfer_get_frame(xfer, 0);
usbd_copy_out(pc, 0, &pkt, sizeof(pkt));
diff --git a/sys/dev/usb/net/if_udav.c b/sys/dev/usb/net/if_udav.c
index 8160a3b..2507846 100644
--- a/sys/dev/usb/net/if_udav.c
+++ b/sys/dev/usb/net/if_udav.c
@@ -642,7 +642,7 @@ udav_bulk_read_callback(struct usb_xfer *xfer, usb_error_t error)
switch (USB_GET_STATE(xfer)) {
case USB_ST_TRANSFERRED:
- if (actlen < sizeof(stat) + ETHER_CRC_LEN) {
+ if (actlen < (int)(sizeof(stat) + ETHER_CRC_LEN)) {
ifp->if_ierrors++;
goto tr_setup;
}
diff --git a/sys/dev/usb/net/if_usie.c b/sys/dev/usb/net/if_usie.c
index ed9054f..813a781 100644
--- a/sys/dev/usb/net/if_usie.c
+++ b/sys/dev/usb/net/if_usie.c
@@ -918,7 +918,7 @@ tr_setup:
if (m == NULL)
break;
- if (m->m_pkthdr.len > (MCLBYTES - ETHER_HDR_LEN +
+ if (m->m_pkthdr.len > (int)(MCLBYTES - ETHER_HDR_LEN +
ETHER_CRC_LEN - sizeof(sc->sc_txd))) {
DPRINTF("packet len is too big: %d\n",
m->m_pkthdr.len);
diff --git a/sys/dev/usb/net/ruephy.c b/sys/dev/usb/net/ruephy.c
index 839c022..bb9931e 100644
--- a/sys/dev/usb/net/ruephy.c
+++ b/sys/dev/usb/net/ruephy.c
@@ -67,9 +67,9 @@ static device_method_t ruephy_methods[] = {
static devclass_t ruephy_devclass;
static driver_t ruephy_driver = {
- "ruephy",
- ruephy_methods,
- sizeof(struct mii_softc)
+ .name = "ruephy",
+ .methods = ruephy_methods,
+ .size = sizeof(struct mii_softc)
};
DRIVER_MODULE(ruephy, miibus, ruephy_driver, ruephy_devclass, 0, 0);
diff --git a/sys/dev/usb/net/uhso.c b/sys/dev/usb/net/uhso.c
index 8211170..e741719 100644
--- a/sys/dev/usb/net/uhso.c
+++ b/sys/dev/usb/net/uhso.c
@@ -482,9 +482,9 @@ static device_method_t uhso_methods[] = {
};
static driver_t uhso_driver = {
- "uhso",
- uhso_methods,
- sizeof(struct uhso_softc)
+ .name = "uhso",
+ .methods = uhso_methods,
+ .size = sizeof(struct uhso_softc)
};
static devclass_t uhso_devclass;
@@ -1366,7 +1366,7 @@ uhso_bs_intr_callback(struct usb_xfer *xfer, usb_error_t error)
UHSO_DPRINTF(0, "UCDC notification too short: %d\n", actlen);
goto tr_setup;
}
- else if (actlen > sizeof(struct usb_cdc_notification)) {
+ else if (actlen > (int)sizeof(struct usb_cdc_notification)) {
UHSO_DPRINTF(0, "UCDC notification too large: %d\n", actlen);
actlen = sizeof(struct usb_cdc_notification);
}
OpenPOWER on IntegriCloud