diff options
author | Jeff Garzik <jeff@garzik.org> | 2007-12-01 16:18:56 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-12-01 16:18:56 -0500 |
commit | c99da91e7a12724127475a85cc7a38214b3504e2 (patch) | |
tree | de0eb3fe32ce58804457963fd133a53bb8fba5b8 /drivers/net | |
parent | a31e23e15cbb9734c5883a4a7f58d8712d303e0b (diff) | |
parent | 92d499d991ec4f5cbd00d6f33967eab9d3ee8d6c (diff) |
Merge branch 'master' into upstream-fixes
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/bfin_mac.c | 2 | ||||
-rw-r--r-- | drivers/net/bfin_mac.h | 2 | ||||
-rw-r--r-- | drivers/net/mlx4/qp.c | 2 | ||||
-rw-r--r-- | drivers/net/plip.c | 4 | ||||
-rw-r--r-- | drivers/net/virtio_net.c | 12 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2500usb.c | 7 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00.h | 7 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00usb.c | 9 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt73usb.c | 4 |
9 files changed, 30 insertions, 19 deletions
diff --git a/drivers/net/bfin_mac.c b/drivers/net/bfin_mac.c index f0f851693897..eb971755a3ff 100644 --- a/drivers/net/bfin_mac.c +++ b/drivers/net/bfin_mac.c | |||
@@ -924,7 +924,7 @@ static int __init bf537mac_probe(struct net_device *dev) | |||
924 | if (!is_valid_ether_addr(dev->dev_addr)) { | 924 | if (!is_valid_ether_addr(dev->dev_addr)) { |
925 | /* Grab the MAC from the board somehow - this is done in the | 925 | /* Grab the MAC from the board somehow - this is done in the |
926 | arch/blackfin/mach-bf537/boards/eth_mac.c */ | 926 | arch/blackfin/mach-bf537/boards/eth_mac.c */ |
927 | get_bf537_ether_addr(dev->dev_addr); | 927 | bfin_get_ether_addr(dev->dev_addr); |
928 | } | 928 | } |
929 | 929 | ||
930 | /* If still not valid, get a random one */ | 930 | /* If still not valid, get a random one */ |
diff --git a/drivers/net/bfin_mac.h b/drivers/net/bfin_mac.h index 3a107ad75381..5970ea7142cd 100644 --- a/drivers/net/bfin_mac.h +++ b/drivers/net/bfin_mac.h | |||
@@ -92,4 +92,4 @@ struct bf537mac_local { | |||
92 | struct mii_bus mii_bus; | 92 | struct mii_bus mii_bus; |
93 | }; | 93 | }; |
94 | 94 | ||
95 | extern void get_bf537_ether_addr(char *addr); | 95 | extern void bfin_get_ether_addr(char *addr); |
diff --git a/drivers/net/mlx4/qp.c b/drivers/net/mlx4/qp.c index 42b47639c81c..fa24e6597591 100644 --- a/drivers/net/mlx4/qp.c +++ b/drivers/net/mlx4/qp.c | |||
@@ -113,7 +113,7 @@ int mlx4_qp_modify(struct mlx4_dev *dev, struct mlx4_mtt *mtt, | |||
113 | struct mlx4_cmd_mailbox *mailbox; | 113 | struct mlx4_cmd_mailbox *mailbox; |
114 | int ret = 0; | 114 | int ret = 0; |
115 | 115 | ||
116 | if (cur_state >= MLX4_QP_NUM_STATE || cur_state >= MLX4_QP_NUM_STATE || | 116 | if (cur_state >= MLX4_QP_NUM_STATE || new_state >= MLX4_QP_NUM_STATE || |
117 | !op[cur_state][new_state]) | 117 | !op[cur_state][new_state]) |
118 | return -EINVAL; | 118 | return -EINVAL; |
119 | 119 | ||
diff --git a/drivers/net/plip.c b/drivers/net/plip.c index 5071fcd8a0bd..57c98669984d 100644 --- a/drivers/net/plip.c +++ b/drivers/net/plip.c | |||
@@ -663,7 +663,7 @@ plip_receive_packet(struct net_device *dev, struct net_local *nl, | |||
663 | case PLIP_PK_DONE: | 663 | case PLIP_PK_DONE: |
664 | /* Inform the upper layer for the arrival of a packet. */ | 664 | /* Inform the upper layer for the arrival of a packet. */ |
665 | rcv->skb->protocol=plip_type_trans(rcv->skb, dev); | 665 | rcv->skb->protocol=plip_type_trans(rcv->skb, dev); |
666 | netif_rx(rcv->skb); | 666 | netif_rx_ni(rcv->skb); |
667 | dev->last_rx = jiffies; | 667 | dev->last_rx = jiffies; |
668 | dev->stats.rx_bytes += rcv->length.h; | 668 | dev->stats.rx_bytes += rcv->length.h; |
669 | dev->stats.rx_packets++; | 669 | dev->stats.rx_packets++; |
@@ -1269,7 +1269,7 @@ static void plip_attach (struct parport *port) | |||
1269 | 1269 | ||
1270 | nl = netdev_priv(dev); | 1270 | nl = netdev_priv(dev); |
1271 | nl->dev = dev; | 1271 | nl->dev = dev; |
1272 | nl->pardev = parport_register_device(port, name, plip_preempt, | 1272 | nl->pardev = parport_register_device(port, dev->name, plip_preempt, |
1273 | plip_wakeup, plip_interrupt, | 1273 | plip_wakeup, plip_interrupt, |
1274 | 0, dev); | 1274 | 0, dev); |
1275 | 1275 | ||
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index a75be57fb209..5413dbf3d4ac 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c | |||
@@ -198,8 +198,8 @@ again: | |||
198 | if (vi->num < vi->max / 2) | 198 | if (vi->num < vi->max / 2) |
199 | try_fill_recv(vi); | 199 | try_fill_recv(vi); |
200 | 200 | ||
201 | /* All done? */ | 201 | /* Out of packets? */ |
202 | if (!skb) { | 202 | if (received < budget) { |
203 | netif_rx_complete(vi->dev, napi); | 203 | netif_rx_complete(vi->dev, napi); |
204 | if (unlikely(!vi->rvq->vq_ops->restart(vi->rvq)) | 204 | if (unlikely(!vi->rvq->vq_ops->restart(vi->rvq)) |
205 | && netif_rx_reschedule(vi->dev, napi)) | 205 | && netif_rx_reschedule(vi->dev, napi)) |
@@ -404,8 +404,12 @@ free: | |||
404 | 404 | ||
405 | static void virtnet_remove(struct virtio_device *vdev) | 405 | static void virtnet_remove(struct virtio_device *vdev) |
406 | { | 406 | { |
407 | unregister_netdev(vdev->priv); | 407 | struct virtnet_info *vi = vdev->priv; |
408 | free_netdev(vdev->priv); | 408 | |
409 | vdev->config->del_vq(vi->svq); | ||
410 | vdev->config->del_vq(vi->rvq); | ||
411 | unregister_netdev(vi->dev); | ||
412 | free_netdev(vi->dev); | ||
409 | } | 413 | } |
410 | 414 | ||
411 | static struct virtio_device_id id_table[] = { | 415 | static struct virtio_device_id id_table[] = { |
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c index 277a020b35e9..50775f9234cc 100644 --- a/drivers/net/wireless/rt2x00/rt2500usb.c +++ b/drivers/net/wireless/rt2x00/rt2500usb.c | |||
@@ -1032,7 +1032,7 @@ static void rt2500usb_write_tx_desc(struct rt2x00_dev *rt2x00dev, | |||
1032 | } | 1032 | } |
1033 | 1033 | ||
1034 | static int rt2500usb_get_tx_data_len(struct rt2x00_dev *rt2x00dev, | 1034 | static int rt2500usb_get_tx_data_len(struct rt2x00_dev *rt2x00dev, |
1035 | int maxpacket, struct sk_buff *skb) | 1035 | struct sk_buff *skb) |
1036 | { | 1036 | { |
1037 | int length; | 1037 | int length; |
1038 | 1038 | ||
@@ -1041,7 +1041,7 @@ static int rt2500usb_get_tx_data_len(struct rt2x00_dev *rt2x00dev, | |||
1041 | * but it must _not_ be a multiple of the USB packet size. | 1041 | * but it must _not_ be a multiple of the USB packet size. |
1042 | */ | 1042 | */ |
1043 | length = roundup(skb->len, 2); | 1043 | length = roundup(skb->len, 2); |
1044 | length += (2 * !(length % maxpacket)); | 1044 | length += (2 * !(length % rt2x00dev->usb_maxpacket)); |
1045 | 1045 | ||
1046 | return length; | 1046 | return length; |
1047 | } | 1047 | } |
@@ -1643,7 +1643,6 @@ static int rt2500usb_beacon_update(struct ieee80211_hw *hw, | |||
1643 | struct data_entry *beacon; | 1643 | struct data_entry *beacon; |
1644 | struct data_entry *guardian; | 1644 | struct data_entry *guardian; |
1645 | int pipe = usb_sndbulkpipe(usb_dev, 1); | 1645 | int pipe = usb_sndbulkpipe(usb_dev, 1); |
1646 | int max_packet = usb_maxpacket(usb_dev, pipe, 1); | ||
1647 | int length; | 1646 | int length; |
1648 | 1647 | ||
1649 | /* | 1648 | /* |
@@ -1672,7 +1671,7 @@ static int rt2500usb_beacon_update(struct ieee80211_hw *hw, | |||
1672 | ring->desc_size), | 1671 | ring->desc_size), |
1673 | skb->len - ring->desc_size, control); | 1672 | skb->len - ring->desc_size, control); |
1674 | 1673 | ||
1675 | length = rt2500usb_get_tx_data_len(rt2x00dev, max_packet, skb); | 1674 | length = rt2500usb_get_tx_data_len(rt2x00dev, skb); |
1676 | 1675 | ||
1677 | usb_fill_bulk_urb(beacon->priv, usb_dev, pipe, | 1676 | usb_fill_bulk_urb(beacon->priv, usb_dev, pipe, |
1678 | skb->data, length, rt2500usb_beacondone, beacon); | 1677 | skb->data, length, rt2500usb_beacondone, beacon); |
diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h index d1ad5251a77a..c8f16f161c28 100644 --- a/drivers/net/wireless/rt2x00/rt2x00.h +++ b/drivers/net/wireless/rt2x00/rt2x00.h | |||
@@ -418,7 +418,7 @@ struct rt2x00lib_ops { | |||
418 | int (*write_tx_data) (struct rt2x00_dev *rt2x00dev, | 418 | int (*write_tx_data) (struct rt2x00_dev *rt2x00dev, |
419 | struct data_ring *ring, struct sk_buff *skb, | 419 | struct data_ring *ring, struct sk_buff *skb, |
420 | struct ieee80211_tx_control *control); | 420 | struct ieee80211_tx_control *control); |
421 | int (*get_tx_data_len) (struct rt2x00_dev *rt2x00dev, int maxpacket, | 421 | int (*get_tx_data_len) (struct rt2x00_dev *rt2x00dev, |
422 | struct sk_buff *skb); | 422 | struct sk_buff *skb); |
423 | void (*kick_tx_queue) (struct rt2x00_dev *rt2x00dev, | 423 | void (*kick_tx_queue) (struct rt2x00_dev *rt2x00dev, |
424 | unsigned int queue); | 424 | unsigned int queue); |
@@ -599,6 +599,11 @@ struct rt2x00_dev { | |||
599 | u32 *rf; | 599 | u32 *rf; |
600 | 600 | ||
601 | /* | 601 | /* |
602 | * USB Max frame size (for rt2500usb & rt73usb). | ||
603 | */ | ||
604 | u16 usb_maxpacket; | ||
605 | |||
606 | /* | ||
602 | * Current TX power value. | 607 | * Current TX power value. |
603 | */ | 608 | */ |
604 | u16 tx_power; | 609 | u16 tx_power; |
diff --git a/drivers/net/wireless/rt2x00/rt2x00usb.c b/drivers/net/wireless/rt2x00/rt2x00usb.c index 73cc726c4046..1f5675dd329f 100644 --- a/drivers/net/wireless/rt2x00/rt2x00usb.c +++ b/drivers/net/wireless/rt2x00/rt2x00usb.c | |||
@@ -159,7 +159,6 @@ int rt2x00usb_write_tx_data(struct rt2x00_dev *rt2x00dev, | |||
159 | interface_to_usbdev(rt2x00dev_usb(rt2x00dev)); | 159 | interface_to_usbdev(rt2x00dev_usb(rt2x00dev)); |
160 | struct data_entry *entry = rt2x00_get_data_entry(ring); | 160 | struct data_entry *entry = rt2x00_get_data_entry(ring); |
161 | int pipe = usb_sndbulkpipe(usb_dev, 1); | 161 | int pipe = usb_sndbulkpipe(usb_dev, 1); |
162 | int max_packet = usb_maxpacket(usb_dev, pipe, 1); | ||
163 | u32 length; | 162 | u32 length; |
164 | 163 | ||
165 | if (rt2x00_ring_full(ring)) { | 164 | if (rt2x00_ring_full(ring)) { |
@@ -194,8 +193,7 @@ int rt2x00usb_write_tx_data(struct rt2x00_dev *rt2x00dev, | |||
194 | * length of the data to usb_fill_bulk_urb. Pass the skb | 193 | * length of the data to usb_fill_bulk_urb. Pass the skb |
195 | * to the driver to determine what the length should be. | 194 | * to the driver to determine what the length should be. |
196 | */ | 195 | */ |
197 | length = rt2x00dev->ops->lib->get_tx_data_len(rt2x00dev, | 196 | length = rt2x00dev->ops->lib->get_tx_data_len(rt2x00dev, skb); |
198 | max_packet, skb); | ||
199 | 197 | ||
200 | /* | 198 | /* |
201 | * Initialize URB and send the frame to the device. | 199 | * Initialize URB and send the frame to the device. |
@@ -490,6 +488,11 @@ int rt2x00usb_probe(struct usb_interface *usb_intf, | |||
490 | rt2x00dev->ops = ops; | 488 | rt2x00dev->ops = ops; |
491 | rt2x00dev->hw = hw; | 489 | rt2x00dev->hw = hw; |
492 | 490 | ||
491 | rt2x00dev->usb_maxpacket = | ||
492 | usb_maxpacket(usb_dev, usb_sndbulkpipe(usb_dev, 1), 1); | ||
493 | if (!rt2x00dev->usb_maxpacket) | ||
494 | rt2x00dev->usb_maxpacket = 1; | ||
495 | |||
493 | retval = rt2x00usb_alloc_reg(rt2x00dev); | 496 | retval = rt2x00usb_alloc_reg(rt2x00dev); |
494 | if (retval) | 497 | if (retval) |
495 | goto exit_free_device; | 498 | goto exit_free_device; |
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c index dc640bf6b5eb..c0671c2e6e73 100644 --- a/drivers/net/wireless/rt2x00/rt73usb.c +++ b/drivers/net/wireless/rt2x00/rt73usb.c | |||
@@ -1251,7 +1251,7 @@ static void rt73usb_write_tx_desc(struct rt2x00_dev *rt2x00dev, | |||
1251 | } | 1251 | } |
1252 | 1252 | ||
1253 | static int rt73usb_get_tx_data_len(struct rt2x00_dev *rt2x00dev, | 1253 | static int rt73usb_get_tx_data_len(struct rt2x00_dev *rt2x00dev, |
1254 | int maxpacket, struct sk_buff *skb) | 1254 | struct sk_buff *skb) |
1255 | { | 1255 | { |
1256 | int length; | 1256 | int length; |
1257 | 1257 | ||
@@ -1260,7 +1260,7 @@ static int rt73usb_get_tx_data_len(struct rt2x00_dev *rt2x00dev, | |||
1260 | * but it must _not_ be a multiple of the USB packet size. | 1260 | * but it must _not_ be a multiple of the USB packet size. |
1261 | */ | 1261 | */ |
1262 | length = roundup(skb->len, 4); | 1262 | length = roundup(skb->len, 4); |
1263 | length += (4 * !(length % maxpacket)); | 1263 | length += (4 * !(length % rt2x00dev->usb_maxpacket)); |
1264 | 1264 | ||
1265 | return length; | 1265 | return length; |
1266 | } | 1266 | } |