diff options
Diffstat (limited to 'drivers/net/usb')
-rw-r--r-- | drivers/net/usb/hso.c | 3 | ||||
-rw-r--r-- | drivers/net/usb/mcs7830.c | 47 | ||||
-rw-r--r-- | drivers/net/usb/pegasus.c | 11 |
3 files changed, 54 insertions, 7 deletions
diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c index 1b7cac77159e..6e42b5a8c22b 100644 --- a/drivers/net/usb/hso.c +++ b/drivers/net/usb/hso.c | |||
@@ -397,7 +397,7 @@ static const struct usb_device_id hso_ids[] = { | |||
397 | {default_port_device(0x0af0, 0xc031)}, /* Icon-Edge */ | 397 | {default_port_device(0x0af0, 0xc031)}, /* Icon-Edge */ |
398 | {icon321_port_device(0x0af0, 0xd013)}, /* Module HSxPA */ | 398 | {icon321_port_device(0x0af0, 0xd013)}, /* Module HSxPA */ |
399 | {icon321_port_device(0x0af0, 0xd031)}, /* Icon-321 */ | 399 | {icon321_port_device(0x0af0, 0xd031)}, /* Icon-321 */ |
400 | {default_port_device(0x0af0, 0xd033)}, /* Icon-322 */ | 400 | {icon321_port_device(0x0af0, 0xd033)}, /* Icon-322 */ |
401 | {USB_DEVICE(0x0af0, 0x7301)}, /* GE40x */ | 401 | {USB_DEVICE(0x0af0, 0x7301)}, /* GE40x */ |
402 | {USB_DEVICE(0x0af0, 0x7361)}, /* GE40x */ | 402 | {USB_DEVICE(0x0af0, 0x7361)}, /* GE40x */ |
403 | {USB_DEVICE(0x0af0, 0x7401)}, /* GI 0401 */ | 403 | {USB_DEVICE(0x0af0, 0x7401)}, /* GI 0401 */ |
@@ -2613,6 +2613,7 @@ static int hso_resume(struct usb_interface *iface) | |||
2613 | "Transmitting lingering data\n"); | 2613 | "Transmitting lingering data\n"); |
2614 | hso_net_start_xmit(hso_net->skb_tx_buf, | 2614 | hso_net_start_xmit(hso_net->skb_tx_buf, |
2615 | hso_net->net); | 2615 | hso_net->net); |
2616 | hso_net->skb_tx_buf = NULL; | ||
2616 | } | 2617 | } |
2617 | result = hso_start_net_device(network_table[i]); | 2618 | result = hso_start_net_device(network_table[i]); |
2618 | if (result) | 2619 | if (result) |
diff --git a/drivers/net/usb/mcs7830.c b/drivers/net/usb/mcs7830.c index c3d119f997f5..ca9d00c1194e 100644 --- a/drivers/net/usb/mcs7830.c +++ b/drivers/net/usb/mcs7830.c | |||
@@ -46,6 +46,10 @@ | |||
46 | 46 | ||
47 | #define MCS7830_VENDOR_ID 0x9710 | 47 | #define MCS7830_VENDOR_ID 0x9710 |
48 | #define MCS7830_PRODUCT_ID 0x7830 | 48 | #define MCS7830_PRODUCT_ID 0x7830 |
49 | #define MCS7730_PRODUCT_ID 0x7730 | ||
50 | |||
51 | #define SITECOM_VENDOR_ID 0x0DF6 | ||
52 | #define LN_030_PRODUCT_ID 0x0021 | ||
49 | 53 | ||
50 | #define MCS7830_MII_ADVERTISE (ADVERTISE_PAUSE_CAP | ADVERTISE_100FULL | \ | 54 | #define MCS7830_MII_ADVERTISE (ADVERTISE_PAUSE_CAP | ADVERTISE_100FULL | \ |
51 | ADVERTISE_100HALF | ADVERTISE_10FULL | \ | 55 | ADVERTISE_100HALF | ADVERTISE_10FULL | \ |
@@ -442,6 +446,29 @@ static struct ethtool_ops mcs7830_ethtool_ops = { | |||
442 | .nway_reset = usbnet_nway_reset, | 446 | .nway_reset = usbnet_nway_reset, |
443 | }; | 447 | }; |
444 | 448 | ||
449 | static int mcs7830_set_mac_address(struct net_device *netdev, void *p) | ||
450 | { | ||
451 | int ret; | ||
452 | struct usbnet *dev = netdev_priv(netdev); | ||
453 | struct sockaddr *addr = p; | ||
454 | |||
455 | if (netif_running(netdev)) | ||
456 | return -EBUSY; | ||
457 | |||
458 | if (!is_valid_ether_addr(addr->sa_data)) | ||
459 | return -EINVAL; | ||
460 | |||
461 | memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len); | ||
462 | |||
463 | ret = mcs7830_set_reg(dev, HIF_REG_ETHERNET_ADDR, ETH_ALEN, | ||
464 | netdev->dev_addr); | ||
465 | |||
466 | if (ret < 0) | ||
467 | return ret; | ||
468 | |||
469 | return 0; | ||
470 | } | ||
471 | |||
445 | static int mcs7830_bind(struct usbnet *dev, struct usb_interface *udev) | 472 | static int mcs7830_bind(struct usbnet *dev, struct usb_interface *udev) |
446 | { | 473 | { |
447 | struct net_device *net = dev->net; | 474 | struct net_device *net = dev->net; |
@@ -455,6 +482,7 @@ static int mcs7830_bind(struct usbnet *dev, struct usb_interface *udev) | |||
455 | net->ethtool_ops = &mcs7830_ethtool_ops; | 482 | net->ethtool_ops = &mcs7830_ethtool_ops; |
456 | net->set_multicast_list = mcs7830_set_multicast; | 483 | net->set_multicast_list = mcs7830_set_multicast; |
457 | mcs7830_set_multicast(net); | 484 | mcs7830_set_multicast(net); |
485 | net->set_mac_address = mcs7830_set_mac_address; | ||
458 | 486 | ||
459 | /* reserve space for the status byte on rx */ | 487 | /* reserve space for the status byte on rx */ |
460 | dev->rx_urb_size = ETH_FRAME_LEN + 1; | 488 | dev->rx_urb_size = ETH_FRAME_LEN + 1; |
@@ -491,7 +519,16 @@ static int mcs7830_rx_fixup(struct usbnet *dev, struct sk_buff *skb) | |||
491 | } | 519 | } |
492 | 520 | ||
493 | static const struct driver_info moschip_info = { | 521 | static const struct driver_info moschip_info = { |
494 | .description = "MOSCHIP 7830 usb-NET adapter", | 522 | .description = "MOSCHIP 7830/7730 usb-NET adapter", |
523 | .bind = mcs7830_bind, | ||
524 | .rx_fixup = mcs7830_rx_fixup, | ||
525 | .flags = FLAG_ETHER, | ||
526 | .in = 1, | ||
527 | .out = 2, | ||
528 | }; | ||
529 | |||
530 | static const struct driver_info sitecom_info = { | ||
531 | .description = "Sitecom LN-30 usb-NET adapter", | ||
495 | .bind = mcs7830_bind, | 532 | .bind = mcs7830_bind, |
496 | .rx_fixup = mcs7830_rx_fixup, | 533 | .rx_fixup = mcs7830_rx_fixup, |
497 | .flags = FLAG_ETHER, | 534 | .flags = FLAG_ETHER, |
@@ -504,6 +541,14 @@ static const struct usb_device_id products[] = { | |||
504 | USB_DEVICE(MCS7830_VENDOR_ID, MCS7830_PRODUCT_ID), | 541 | USB_DEVICE(MCS7830_VENDOR_ID, MCS7830_PRODUCT_ID), |
505 | .driver_info = (unsigned long) &moschip_info, | 542 | .driver_info = (unsigned long) &moschip_info, |
506 | }, | 543 | }, |
544 | { | ||
545 | USB_DEVICE(MCS7830_VENDOR_ID, MCS7730_PRODUCT_ID), | ||
546 | .driver_info = (unsigned long) &moschip_info, | ||
547 | }, | ||
548 | { | ||
549 | USB_DEVICE(SITECOM_VENDOR_ID, LN_030_PRODUCT_ID), | ||
550 | .driver_info = (unsigned long) &sitecom_info, | ||
551 | }, | ||
507 | {}, | 552 | {}, |
508 | }; | 553 | }; |
509 | MODULE_DEVICE_TABLE(usb, products); | 554 | MODULE_DEVICE_TABLE(usb, products); |
diff --git a/drivers/net/usb/pegasus.c b/drivers/net/usb/pegasus.c index a84ba487c713..8c19307e5040 100644 --- a/drivers/net/usb/pegasus.c +++ b/drivers/net/usb/pegasus.c | |||
@@ -117,7 +117,7 @@ static void ctrl_callback(struct urb *urb) | |||
117 | case -ENOENT: | 117 | case -ENOENT: |
118 | break; | 118 | break; |
119 | default: | 119 | default: |
120 | if (netif_msg_drv(pegasus)) | 120 | if (netif_msg_drv(pegasus) && printk_ratelimit()) |
121 | dev_dbg(&pegasus->intf->dev, "%s, status %d\n", | 121 | dev_dbg(&pegasus->intf->dev, "%s, status %d\n", |
122 | __FUNCTION__, urb->status); | 122 | __FUNCTION__, urb->status); |
123 | } | 123 | } |
@@ -166,7 +166,7 @@ static int get_registers(pegasus_t * pegasus, __u16 indx, __u16 size, | |||
166 | set_current_state(TASK_RUNNING); | 166 | set_current_state(TASK_RUNNING); |
167 | if (ret == -ENODEV) | 167 | if (ret == -ENODEV) |
168 | netif_device_detach(pegasus->net); | 168 | netif_device_detach(pegasus->net); |
169 | if (netif_msg_drv(pegasus)) | 169 | if (netif_msg_drv(pegasus) && printk_ratelimit()) |
170 | dev_err(&pegasus->intf->dev, "%s, status %d\n", | 170 | dev_err(&pegasus->intf->dev, "%s, status %d\n", |
171 | __FUNCTION__, ret); | 171 | __FUNCTION__, ret); |
172 | goto out; | 172 | goto out; |
@@ -275,7 +275,7 @@ static int set_register(pegasus_t * pegasus, __u16 indx, __u8 data) | |||
275 | if ((ret = usb_submit_urb(pegasus->ctrl_urb, GFP_ATOMIC))) { | 275 | if ((ret = usb_submit_urb(pegasus->ctrl_urb, GFP_ATOMIC))) { |
276 | if (ret == -ENODEV) | 276 | if (ret == -ENODEV) |
277 | netif_device_detach(pegasus->net); | 277 | netif_device_detach(pegasus->net); |
278 | if (netif_msg_drv(pegasus)) | 278 | if (netif_msg_drv(pegasus) && printk_ratelimit()) |
279 | dev_err(&pegasus->intf->dev, "%s, status %d\n", | 279 | dev_err(&pegasus->intf->dev, "%s, status %d\n", |
280 | __FUNCTION__, ret); | 280 | __FUNCTION__, ret); |
281 | goto out; | 281 | goto out; |
@@ -1209,8 +1209,7 @@ static void pegasus_set_multicast(struct net_device *net) | |||
1209 | pegasus->eth_regs[EthCtrl2] |= RX_PROMISCUOUS; | 1209 | pegasus->eth_regs[EthCtrl2] |= RX_PROMISCUOUS; |
1210 | if (netif_msg_link(pegasus)) | 1210 | if (netif_msg_link(pegasus)) |
1211 | pr_info("%s: Promiscuous mode enabled.\n", net->name); | 1211 | pr_info("%s: Promiscuous mode enabled.\n", net->name); |
1212 | } else if (net->mc_count || | 1212 | } else if (net->mc_count || (net->flags & IFF_ALLMULTI)) { |
1213 | (net->flags & IFF_ALLMULTI)) { | ||
1214 | pegasus->eth_regs[EthCtrl0] |= RX_MULTICAST; | 1213 | pegasus->eth_regs[EthCtrl0] |= RX_MULTICAST; |
1215 | pegasus->eth_regs[EthCtrl2] &= ~RX_PROMISCUOUS; | 1214 | pegasus->eth_regs[EthCtrl2] &= ~RX_PROMISCUOUS; |
1216 | if (netif_msg_link(pegasus)) | 1215 | if (netif_msg_link(pegasus)) |
@@ -1220,6 +1219,8 @@ static void pegasus_set_multicast(struct net_device *net) | |||
1220 | pegasus->eth_regs[EthCtrl2] &= ~RX_PROMISCUOUS; | 1219 | pegasus->eth_regs[EthCtrl2] &= ~RX_PROMISCUOUS; |
1221 | } | 1220 | } |
1222 | 1221 | ||
1222 | pegasus->ctrl_urb->status = 0; | ||
1223 | |||
1223 | pegasus->flags |= ETH_REGS_CHANGE; | 1224 | pegasus->flags |= ETH_REGS_CHANGE; |
1224 | ctrl_callback(pegasus->ctrl_urb); | 1225 | ctrl_callback(pegasus->ctrl_urb); |
1225 | } | 1226 | } |