usbnet.c (d5432503bfb49f3425bad0b850714ffd8b533cfc) usbnet.c (1efed2d06c703489342ab6af2951683e07509c99)
1/*
2 * USB Network driver infrastructure
3 * Copyright (C) 2000-2005 by David Brownell
4 * Copyright (C) 2003-2005 David Hollis <dhollis@davehollis.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or

--- 1038 unchanged lines hidden (view full) ---

1047 }
1048
1049 /* hard_mtu or rx_urb_size may change during link change */
1050 usbnet_update_max_qlen(dev);
1051
1052 clear_bit(EVENT_LINK_CHANGE, &dev->flags);
1053}
1054
1/*
2 * USB Network driver infrastructure
3 * Copyright (C) 2000-2005 by David Brownell
4 * Copyright (C) 2003-2005 David Hollis <dhollis@davehollis.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or

--- 1038 unchanged lines hidden (view full) ---

1047 }
1048
1049 /* hard_mtu or rx_urb_size may change during link change */
1050 usbnet_update_max_qlen(dev);
1051
1052 clear_bit(EVENT_LINK_CHANGE, &dev->flags);
1053}
1054
1055static void usbnet_set_rx_mode(struct net_device *net)
1056{
1057 struct usbnet *dev = netdev_priv(net);
1058
1059 usbnet_defer_kevent(dev, EVENT_SET_RX_MODE);
1060}
1061
1062static void __handle_set_rx_mode(struct usbnet *dev)
1063{
1064 if (dev->driver_info->set_rx_mode)
1065 (dev->driver_info->set_rx_mode)(dev);
1066
1067 clear_bit(EVENT_SET_RX_MODE, &dev->flags);
1068}
1069
1055/* work that cannot be done in interrupt context uses keventd.
1056 *
1057 * NOTE: with 2.5 we could do more of this using completion callbacks,
1058 * especially now that control transfers can be queued.
1059 */
1060static void
1061kevent (struct work_struct *work)
1062{

--- 89 unchanged lines hidden (view full) ---

1152
1153 /* handle link change from link resetting */
1154 __handle_link_change(dev);
1155 }
1156
1157 if (test_bit (EVENT_LINK_CHANGE, &dev->flags))
1158 __handle_link_change(dev);
1159
1070/* work that cannot be done in interrupt context uses keventd.
1071 *
1072 * NOTE: with 2.5 we could do more of this using completion callbacks,
1073 * especially now that control transfers can be queued.
1074 */
1075static void
1076kevent (struct work_struct *work)
1077{

--- 89 unchanged lines hidden (view full) ---

1167
1168 /* handle link change from link resetting */
1169 __handle_link_change(dev);
1170 }
1171
1172 if (test_bit (EVENT_LINK_CHANGE, &dev->flags))
1173 __handle_link_change(dev);
1174
1175 if (test_bit (EVENT_SET_RX_MODE, &dev->flags))
1176 __handle_set_rx_mode(dev);
1177
1178
1160 if (dev->flags)
1161 netdev_dbg(dev->net, "kevent done, flags = 0x%lx\n", dev->flags);
1162}
1163
1164/*-------------------------------------------------------------------------*/
1165
1166static void tx_complete (struct urb *urb)
1167{

--- 352 unchanged lines hidden (view full) ---

1520}
1521EXPORT_SYMBOL_GPL(usbnet_disconnect);
1522
1523static const struct net_device_ops usbnet_netdev_ops = {
1524 .ndo_open = usbnet_open,
1525 .ndo_stop = usbnet_stop,
1526 .ndo_start_xmit = usbnet_start_xmit,
1527 .ndo_tx_timeout = usbnet_tx_timeout,
1179 if (dev->flags)
1180 netdev_dbg(dev->net, "kevent done, flags = 0x%lx\n", dev->flags);
1181}
1182
1183/*-------------------------------------------------------------------------*/
1184
1185static void tx_complete (struct urb *urb)
1186{

--- 352 unchanged lines hidden (view full) ---

1539}
1540EXPORT_SYMBOL_GPL(usbnet_disconnect);
1541
1542static const struct net_device_ops usbnet_netdev_ops = {
1543 .ndo_open = usbnet_open,
1544 .ndo_stop = usbnet_stop,
1545 .ndo_start_xmit = usbnet_start_xmit,
1546 .ndo_tx_timeout = usbnet_tx_timeout,
1547 .ndo_set_rx_mode = usbnet_set_rx_mode,
1528 .ndo_change_mtu = usbnet_change_mtu,
1529 .ndo_set_mac_address = eth_mac_addr,
1530 .ndo_validate_addr = eth_validate_addr,
1531};
1532
1533/*-------------------------------------------------------------------------*/
1534
1535// precondition: never called in_interrupt

--- 542 unchanged lines hidden ---
1548 .ndo_change_mtu = usbnet_change_mtu,
1549 .ndo_set_mac_address = eth_mac_addr,
1550 .ndo_validate_addr = eth_validate_addr,
1551};
1552
1553/*-------------------------------------------------------------------------*/
1554
1555// precondition: never called in_interrupt

--- 542 unchanged lines hidden ---