diff options
author | Jiri Pirko <jpirko@redhat.com> | 2011-07-20 00:54:24 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-07-21 16:47:55 -0400 |
commit | b85da2c00453d9b97e66b5be7d035d6e0736eca0 (patch) | |
tree | ba00ab2836aeff2a8fd000edd35e7f1366b4f09a /drivers/net | |
parent | 18c49b91777c66265d640f8fb221039bdf46b2d3 (diff) |
s2io: do vlan cleanup
- unify vlan and nonvlan rx path
- kill sp->vlgrp and s2io_vlan_rx_register and s2io_vlan_rx_kill_vid
(which does nothing and is never called :))
Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/s2io.c | 70 | ||||
-rw-r--r-- | drivers/net/s2io.h | 1 |
2 files changed, 6 insertions, 65 deletions
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c index 043850b8c304..277d48b0800a 100644 --- a/drivers/net/s2io.c +++ b/drivers/net/s2io.c | |||
@@ -356,56 +356,6 @@ static void do_s2io_copy_mac_addr(struct s2io_nic *sp, int offset, u64 mac_addr) | |||
356 | sp->def_mac_addr[offset].mac_addr[0] = (u8) (mac_addr >> 40); | 356 | sp->def_mac_addr[offset].mac_addr[0] = (u8) (mac_addr >> 40); |
357 | } | 357 | } |
358 | 358 | ||
359 | /* Add the vlan */ | ||
360 | static void s2io_vlan_rx_register(struct net_device *dev, | ||
361 | struct vlan_group *grp) | ||
362 | { | ||
363 | int i; | ||
364 | struct s2io_nic *nic = netdev_priv(dev); | ||
365 | unsigned long flags[MAX_TX_FIFOS]; | ||
366 | struct config_param *config = &nic->config; | ||
367 | struct mac_info *mac_control = &nic->mac_control; | ||
368 | |||
369 | for (i = 0; i < config->tx_fifo_num; i++) { | ||
370 | struct fifo_info *fifo = &mac_control->fifos[i]; | ||
371 | |||
372 | spin_lock_irqsave(&fifo->tx_lock, flags[i]); | ||
373 | } | ||
374 | |||
375 | nic->vlgrp = grp; | ||
376 | |||
377 | for (i = config->tx_fifo_num - 1; i >= 0; i--) { | ||
378 | struct fifo_info *fifo = &mac_control->fifos[i]; | ||
379 | |||
380 | spin_unlock_irqrestore(&fifo->tx_lock, flags[i]); | ||
381 | } | ||
382 | } | ||
383 | |||
384 | /* Unregister the vlan */ | ||
385 | static void s2io_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) | ||
386 | { | ||
387 | int i; | ||
388 | struct s2io_nic *nic = netdev_priv(dev); | ||
389 | unsigned long flags[MAX_TX_FIFOS]; | ||
390 | struct config_param *config = &nic->config; | ||
391 | struct mac_info *mac_control = &nic->mac_control; | ||
392 | |||
393 | for (i = 0; i < config->tx_fifo_num; i++) { | ||
394 | struct fifo_info *fifo = &mac_control->fifos[i]; | ||
395 | |||
396 | spin_lock_irqsave(&fifo->tx_lock, flags[i]); | ||
397 | } | ||
398 | |||
399 | if (nic->vlgrp) | ||
400 | vlan_group_set_device(nic->vlgrp, vid, NULL); | ||
401 | |||
402 | for (i = config->tx_fifo_num - 1; i >= 0; i--) { | ||
403 | struct fifo_info *fifo = &mac_control->fifos[i]; | ||
404 | |||
405 | spin_unlock_irqrestore(&fifo->tx_lock, flags[i]); | ||
406 | } | ||
407 | } | ||
408 | |||
409 | /* | 359 | /* |
410 | * Constants to be programmed into the Xena's registers, to configure | 360 | * Constants to be programmed into the Xena's registers, to configure |
411 | * the XAUI. | 361 | * the XAUI. |
@@ -7737,8 +7687,6 @@ static const struct net_device_ops s2io_netdev_ops = { | |||
7737 | .ndo_set_mac_address = s2io_set_mac_addr, | 7687 | .ndo_set_mac_address = s2io_set_mac_addr, |
7738 | .ndo_change_mtu = s2io_change_mtu, | 7688 | .ndo_change_mtu = s2io_change_mtu, |
7739 | .ndo_set_features = s2io_set_features, | 7689 | .ndo_set_features = s2io_set_features, |
7740 | .ndo_vlan_rx_register = s2io_vlan_rx_register, | ||
7741 | .ndo_vlan_rx_kill_vid = s2io_vlan_rx_kill_vid, | ||
7742 | .ndo_tx_timeout = s2io_tx_watchdog, | 7690 | .ndo_tx_timeout = s2io_tx_watchdog, |
7743 | #ifdef CONFIG_NET_POLL_CONTROLLER | 7691 | #ifdef CONFIG_NET_POLL_CONTROLLER |
7744 | .ndo_poll_controller = s2io_netpoll, | 7692 | .ndo_poll_controller = s2io_netpoll, |
@@ -8617,18 +8565,12 @@ static void queue_rx_frame(struct sk_buff *skb, u16 vlan_tag) | |||
8617 | struct s2io_nic *sp = netdev_priv(dev); | 8565 | struct s2io_nic *sp = netdev_priv(dev); |
8618 | 8566 | ||
8619 | skb->protocol = eth_type_trans(skb, dev); | 8567 | skb->protocol = eth_type_trans(skb, dev); |
8620 | if (sp->vlgrp && vlan_tag && (sp->vlan_strip_flag)) { | 8568 | if (vlan_tag && sp->vlan_strip_flag) |
8621 | /* Queueing the vlan frame to the upper layer */ | 8569 | __vlan_hwaccel_put_tag(skb, vlan_tag); |
8622 | if (sp->config.napi) | 8570 | if (sp->config.napi) |
8623 | vlan_hwaccel_receive_skb(skb, sp->vlgrp, vlan_tag); | 8571 | netif_receive_skb(skb); |
8624 | else | 8572 | else |
8625 | vlan_hwaccel_rx(skb, sp->vlgrp, vlan_tag); | 8573 | netif_rx(skb); |
8626 | } else { | ||
8627 | if (sp->config.napi) | ||
8628 | netif_receive_skb(skb); | ||
8629 | else | ||
8630 | netif_rx(skb); | ||
8631 | } | ||
8632 | } | 8574 | } |
8633 | 8575 | ||
8634 | static void lro_append_pkt(struct s2io_nic *sp, struct lro *lro, | 8576 | static void lro_append_pkt(struct s2io_nic *sp, struct lro *lro, |
diff --git a/drivers/net/s2io.h b/drivers/net/s2io.h index 800b3a44e653..ae3c8e79b32f 100644 --- a/drivers/net/s2io.h +++ b/drivers/net/s2io.h | |||
@@ -939,7 +939,6 @@ struct s2io_nic { | |||
939 | 939 | ||
940 | int task_flag; | 940 | int task_flag; |
941 | unsigned long long start_time; | 941 | unsigned long long start_time; |
942 | struct vlan_group *vlgrp; | ||
943 | int vlan_strip_flag; | 942 | int vlan_strip_flag; |
944 | #define MSIX_FLG 0xA5 | 943 | #define MSIX_FLG 0xA5 |
945 | int num_entries; | 944 | int num_entries; |