diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-04-11 10:27:24 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-04-11 10:27:24 -0400 |
commit | c44eaf41a5a423993932c9a9ad279ee132779b48 (patch) | |
tree | 3554fc0bfdcd97936417d6d001d00710d11e67e5 /drivers/net/wireless/zd1211rw | |
parent | 4263a2f1dad8c8e7ce2352a0cbc882c2b0c044a9 (diff) | |
parent | 88edaa415966af965bb7eb7056d8b58145462c8e (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (34 commits)
net: Add support for SMSC LAN9530, LAN9730 and LAN89530
mlx4_en: Restoring RX buffer pointer in case of failure
mlx4: Sensing link type at device initialization
ipv4: Fix "Set rt->rt_iif more sanely on output routes."
MAINTAINERS: add entry for Xen network backend
be2net: Fix suspend/resume operation
be2net: Rename some struct members for clarity
pppoe: drop PPPOX_ZOMBIEs in pppoe_flush_dev
dsa/mv88e6131: add support for mv88e6085 switch
ipv6: Enable RFS sk_rxhash tracking for ipv6 sockets (v2)
be2net: Fix a potential crash during shutdown.
bna: Fix for handling firmware heartbeat failure
can: mcp251x: Allow pass IRQ flags through platform data.
smsc911x: fix mac_lock acquision before calling smsc911x_mac_read
iwlwifi: accept EEPROM version 0x423 for iwl6000
rt2x00: fix cancelling uninitialized work
rtlwifi: Fix some warnings/bugs
p54usb: IDs for two new devices
wl12xx: fix potential buffer overflow in testmode nvs push
zd1211rw: reset rx idle timer from tasklet
...
Diffstat (limited to 'drivers/net/wireless/zd1211rw')
-rw-r--r-- | drivers/net/wireless/zd1211rw/zd_usb.c | 20 | ||||
-rw-r--r-- | drivers/net/wireless/zd1211rw/zd_usb.h | 1 |
2 files changed, 19 insertions, 2 deletions
diff --git a/drivers/net/wireless/zd1211rw/zd_usb.c b/drivers/net/wireless/zd1211rw/zd_usb.c index 58236e6d0921..ab607bbd6291 100644 --- a/drivers/net/wireless/zd1211rw/zd_usb.c +++ b/drivers/net/wireless/zd1211rw/zd_usb.c | |||
@@ -643,7 +643,7 @@ static void rx_urb_complete(struct urb *urb) | |||
643 | usb = urb->context; | 643 | usb = urb->context; |
644 | rx = &usb->rx; | 644 | rx = &usb->rx; |
645 | 645 | ||
646 | zd_usb_reset_rx_idle_timer(usb); | 646 | tasklet_schedule(&rx->reset_timer_tasklet); |
647 | 647 | ||
648 | if (length%rx->usb_packet_size > rx->usb_packet_size-4) { | 648 | if (length%rx->usb_packet_size > rx->usb_packet_size-4) { |
649 | /* If there is an old first fragment, we don't care. */ | 649 | /* If there is an old first fragment, we don't care. */ |
@@ -812,6 +812,7 @@ void zd_usb_disable_rx(struct zd_usb *usb) | |||
812 | __zd_usb_disable_rx(usb); | 812 | __zd_usb_disable_rx(usb); |
813 | mutex_unlock(&rx->setup_mutex); | 813 | mutex_unlock(&rx->setup_mutex); |
814 | 814 | ||
815 | tasklet_kill(&rx->reset_timer_tasklet); | ||
815 | cancel_delayed_work_sync(&rx->idle_work); | 816 | cancel_delayed_work_sync(&rx->idle_work); |
816 | } | 817 | } |
817 | 818 | ||
@@ -1106,6 +1107,13 @@ static void zd_rx_idle_timer_handler(struct work_struct *work) | |||
1106 | zd_usb_reset_rx(usb); | 1107 | zd_usb_reset_rx(usb); |
1107 | } | 1108 | } |
1108 | 1109 | ||
1110 | static void zd_usb_reset_rx_idle_timer_tasklet(unsigned long param) | ||
1111 | { | ||
1112 | struct zd_usb *usb = (struct zd_usb *)param; | ||
1113 | |||
1114 | zd_usb_reset_rx_idle_timer(usb); | ||
1115 | } | ||
1116 | |||
1109 | void zd_usb_reset_rx_idle_timer(struct zd_usb *usb) | 1117 | void zd_usb_reset_rx_idle_timer(struct zd_usb *usb) |
1110 | { | 1118 | { |
1111 | struct zd_usb_rx *rx = &usb->rx; | 1119 | struct zd_usb_rx *rx = &usb->rx; |
@@ -1127,6 +1135,7 @@ static inline void init_usb_interrupt(struct zd_usb *usb) | |||
1127 | static inline void init_usb_rx(struct zd_usb *usb) | 1135 | static inline void init_usb_rx(struct zd_usb *usb) |
1128 | { | 1136 | { |
1129 | struct zd_usb_rx *rx = &usb->rx; | 1137 | struct zd_usb_rx *rx = &usb->rx; |
1138 | |||
1130 | spin_lock_init(&rx->lock); | 1139 | spin_lock_init(&rx->lock); |
1131 | mutex_init(&rx->setup_mutex); | 1140 | mutex_init(&rx->setup_mutex); |
1132 | if (interface_to_usbdev(usb->intf)->speed == USB_SPEED_HIGH) { | 1141 | if (interface_to_usbdev(usb->intf)->speed == USB_SPEED_HIGH) { |
@@ -1136,11 +1145,14 @@ static inline void init_usb_rx(struct zd_usb *usb) | |||
1136 | } | 1145 | } |
1137 | ZD_ASSERT(rx->fragment_length == 0); | 1146 | ZD_ASSERT(rx->fragment_length == 0); |
1138 | INIT_DELAYED_WORK(&rx->idle_work, zd_rx_idle_timer_handler); | 1147 | INIT_DELAYED_WORK(&rx->idle_work, zd_rx_idle_timer_handler); |
1148 | rx->reset_timer_tasklet.func = zd_usb_reset_rx_idle_timer_tasklet; | ||
1149 | rx->reset_timer_tasklet.data = (unsigned long)usb; | ||
1139 | } | 1150 | } |
1140 | 1151 | ||
1141 | static inline void init_usb_tx(struct zd_usb *usb) | 1152 | static inline void init_usb_tx(struct zd_usb *usb) |
1142 | { | 1153 | { |
1143 | struct zd_usb_tx *tx = &usb->tx; | 1154 | struct zd_usb_tx *tx = &usb->tx; |
1155 | |||
1144 | spin_lock_init(&tx->lock); | 1156 | spin_lock_init(&tx->lock); |
1145 | atomic_set(&tx->enabled, 0); | 1157 | atomic_set(&tx->enabled, 0); |
1146 | tx->stopped = 0; | 1158 | tx->stopped = 0; |
@@ -1671,6 +1683,10 @@ static void iowrite16v_urb_complete(struct urb *urb) | |||
1671 | 1683 | ||
1672 | if (urb->status && !usb->cmd_error) | 1684 | if (urb->status && !usb->cmd_error) |
1673 | usb->cmd_error = urb->status; | 1685 | usb->cmd_error = urb->status; |
1686 | |||
1687 | if (!usb->cmd_error && | ||
1688 | urb->actual_length != urb->transfer_buffer_length) | ||
1689 | usb->cmd_error = -EIO; | ||
1674 | } | 1690 | } |
1675 | 1691 | ||
1676 | static int zd_submit_waiting_urb(struct zd_usb *usb, bool last) | 1692 | static int zd_submit_waiting_urb(struct zd_usb *usb, bool last) |
@@ -1805,7 +1821,7 @@ int zd_usb_iowrite16v_async(struct zd_usb *usb, const struct zd_ioreq16 *ioreqs, | |||
1805 | usb_fill_int_urb(urb, udev, usb_sndintpipe(udev, EP_REGS_OUT), | 1821 | usb_fill_int_urb(urb, udev, usb_sndintpipe(udev, EP_REGS_OUT), |
1806 | req, req_len, iowrite16v_urb_complete, usb, | 1822 | req, req_len, iowrite16v_urb_complete, usb, |
1807 | ep->desc.bInterval); | 1823 | ep->desc.bInterval); |
1808 | urb->transfer_flags |= URB_FREE_BUFFER | URB_SHORT_NOT_OK; | 1824 | urb->transfer_flags |= URB_FREE_BUFFER; |
1809 | 1825 | ||
1810 | /* Submit previous URB */ | 1826 | /* Submit previous URB */ |
1811 | r = zd_submit_waiting_urb(usb, false); | 1827 | r = zd_submit_waiting_urb(usb, false); |
diff --git a/drivers/net/wireless/zd1211rw/zd_usb.h b/drivers/net/wireless/zd1211rw/zd_usb.h index b3df2c8116cc..325d0f989257 100644 --- a/drivers/net/wireless/zd1211rw/zd_usb.h +++ b/drivers/net/wireless/zd1211rw/zd_usb.h | |||
@@ -183,6 +183,7 @@ struct zd_usb_rx { | |||
183 | spinlock_t lock; | 183 | spinlock_t lock; |
184 | struct mutex setup_mutex; | 184 | struct mutex setup_mutex; |
185 | struct delayed_work idle_work; | 185 | struct delayed_work idle_work; |
186 | struct tasklet_struct reset_timer_tasklet; | ||
186 | u8 fragment[2 * USB_MAX_RX_SIZE]; | 187 | u8 fragment[2 * USB_MAX_RX_SIZE]; |
187 | unsigned int fragment_length; | 188 | unsigned int fragment_length; |
188 | unsigned int usb_packet_size; | 189 | unsigned int usb_packet_size; |