aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/usb
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/usb')
-rw-r--r--drivers/net/usb/dm9601.c6
-rw-r--r--drivers/net/usb/rndis_host.c21
-rw-r--r--drivers/net/usb/rtl8150.c2
3 files changed, 20 insertions, 9 deletions
diff --git a/drivers/net/usb/dm9601.c b/drivers/net/usb/dm9601.c
index 4b131a6c6b70..0343b00cf1fd 100644
--- a/drivers/net/usb/dm9601.c
+++ b/drivers/net/usb/dm9601.c
@@ -341,7 +341,7 @@ static void dm9601_set_multicast(struct net_device *net)
341 /* We use the 20 byte dev->data for our 8 byte filter buffer 341 /* We use the 20 byte dev->data for our 8 byte filter buffer
342 * to avoid allocating memory that is tricky to free later */ 342 * to avoid allocating memory that is tricky to free later */
343 u8 *hashes = (u8 *) & dev->data; 343 u8 *hashes = (u8 *) & dev->data;
344 u8 rx_ctl = 0x01; 344 u8 rx_ctl = 0x31;
345 345
346 memset(hashes, 0x00, DM_MCAST_SIZE); 346 memset(hashes, 0x00, DM_MCAST_SIZE);
347 hashes[DM_MCAST_SIZE - 1] |= 0x80; /* broadcast address */ 347 hashes[DM_MCAST_SIZE - 1] |= 0x80; /* broadcast address */
@@ -562,6 +562,10 @@ static const struct usb_device_id products[] = {
562 USB_DEVICE(0x0a46, 0x8515), /* ADMtek ADM8515 USB NIC */ 562 USB_DEVICE(0x0a46, 0x8515), /* ADMtek ADM8515 USB NIC */
563 .driver_info = (unsigned long)&dm9601_info, 563 .driver_info = (unsigned long)&dm9601_info,
564 }, 564 },
565 {
566 USB_DEVICE(0x0a47, 0x9601), /* Hirose USB-100 */
567 .driver_info = (unsigned long)&dm9601_info,
568 },
565 {}, // END 569 {}, // END
566}; 570};
567 571
diff --git a/drivers/net/usb/rndis_host.c b/drivers/net/usb/rndis_host.c
index a61324757b17..369c731114b3 100644
--- a/drivers/net/usb/rndis_host.c
+++ b/drivers/net/usb/rndis_host.c
@@ -16,10 +16,6 @@
16 * along with this program; if not, write to the Free Software 16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */ 18 */
19
20// #define DEBUG // error path messages, extra info
21// #define VERBOSE // more; success messages
22
23#include <linux/module.h> 19#include <linux/module.h>
24#include <linux/init.h> 20#include <linux/init.h>
25#include <linux/netdevice.h> 21#include <linux/netdevice.h>
@@ -287,7 +283,7 @@ generic_rndis_bind(struct usbnet *dev, struct usb_interface *intf, int flags)
287 struct rndis_set_c *set_c; 283 struct rndis_set_c *set_c;
288 struct rndis_halt *halt; 284 struct rndis_halt *halt;
289 } u; 285 } u;
290 u32 tmp, *phym; 286 u32 tmp, phym_unspec, *phym;
291 int reply_len; 287 int reply_len;
292 unsigned char *bp; 288 unsigned char *bp;
293 289
@@ -318,6 +314,14 @@ generic_rndis_bind(struct usbnet *dev, struct usb_interface *intf, int flags)
318 net->hard_header_len += sizeof (struct rndis_data_hdr); 314 net->hard_header_len += sizeof (struct rndis_data_hdr);
319 dev->hard_mtu = net->mtu + net->hard_header_len; 315 dev->hard_mtu = net->mtu + net->hard_header_len;
320 316
317 dev->maxpacket = usb_maxpacket(dev->udev, dev->out, 1);
318 if (dev->maxpacket == 0) {
319 if (netif_msg_probe(dev))
320 dev_dbg(&intf->dev, "dev->maxpacket can't be 0\n");
321 retval = -EINVAL;
322 goto fail_and_release;
323 }
324
321 dev->rx_urb_size = dev->hard_mtu + (dev->maxpacket + 1); 325 dev->rx_urb_size = dev->hard_mtu + (dev->maxpacket + 1);
322 dev->rx_urb_size &= ~(dev->maxpacket - 1); 326 dev->rx_urb_size &= ~(dev->maxpacket - 1);
323 u.init->max_transfer_size = cpu_to_le32(dev->rx_urb_size); 327 u.init->max_transfer_size = cpu_to_le32(dev->rx_urb_size);
@@ -359,12 +363,15 @@ generic_rndis_bind(struct usbnet *dev, struct usb_interface *intf, int flags)
359 goto halt_fail_and_release; 363 goto halt_fail_and_release;
360 364
361 /* Check physical medium */ 365 /* Check physical medium */
366 phym = NULL;
362 reply_len = sizeof *phym; 367 reply_len = sizeof *phym;
363 retval = rndis_query(dev, intf, u.buf, OID_GEN_PHYSICAL_MEDIUM, 368 retval = rndis_query(dev, intf, u.buf, OID_GEN_PHYSICAL_MEDIUM,
364 0, (void **) &phym, &reply_len); 369 0, (void **) &phym, &reply_len);
365 if (retval != 0) 370 if (retval != 0 || !phym) {
366 /* OID is optional so don't fail here. */ 371 /* OID is optional so don't fail here. */
367 *phym = RNDIS_PHYSICAL_MEDIUM_UNSPECIFIED; 372 phym_unspec = RNDIS_PHYSICAL_MEDIUM_UNSPECIFIED;
373 phym = &phym_unspec;
374 }
368 if ((flags & FLAG_RNDIS_PHYM_WIRELESS) && 375 if ((flags & FLAG_RNDIS_PHYM_WIRELESS) &&
369 *phym != RNDIS_PHYSICAL_MEDIUM_WIRELESS_LAN) { 376 *phym != RNDIS_PHYSICAL_MEDIUM_WIRELESS_LAN) {
370 if (netif_msg_probe(dev)) 377 if (netif_msg_probe(dev))
diff --git a/drivers/net/usb/rtl8150.c b/drivers/net/usb/rtl8150.c
index 7e1f00131f91..df56a518691c 100644
--- a/drivers/net/usb/rtl8150.c
+++ b/drivers/net/usb/rtl8150.c
@@ -376,7 +376,7 @@ static int alloc_all_urbs(rtl8150_t * dev)
376 return 0; 376 return 0;
377 } 377 }
378 dev->ctrl_urb = usb_alloc_urb(0, GFP_KERNEL); 378 dev->ctrl_urb = usb_alloc_urb(0, GFP_KERNEL);
379 if (!dev->intr_urb) { 379 if (!dev->ctrl_urb) {
380 usb_free_urb(dev->rx_urb); 380 usb_free_urb(dev->rx_urb);
381 usb_free_urb(dev->tx_urb); 381 usb_free_urb(dev->tx_urb);
382 usb_free_urb(dev->intr_urb); 382 usb_free_urb(dev->intr_urb);