Commit b85da2c00453d9b97e66b5be7d035d6e0736eca0
Committed by
David S. Miller
1 parent
18c49b9177
Exists in
master
and in
38 other branches
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>
Showing 2 changed files with 6 additions and 65 deletions Side-by-side Diff
drivers/net/s2io.c
... | ... | @@ -356,56 +356,6 @@ |
356 | 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 | 360 | * Constants to be programmed into the Xena's registers, to configure |
411 | 361 | * the XAUI. |
... | ... | @@ -7737,8 +7687,6 @@ |
7737 | 7687 | .ndo_set_mac_address = s2io_set_mac_addr, |
7738 | 7688 | .ndo_change_mtu = s2io_change_mtu, |
7739 | 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 | 7690 | .ndo_tx_timeout = s2io_tx_watchdog, |
7743 | 7691 | #ifdef CONFIG_NET_POLL_CONTROLLER |
7744 | 7692 | .ndo_poll_controller = s2io_netpoll, |
... | ... | @@ -8617,18 +8565,12 @@ |
8617 | 8565 | struct s2io_nic *sp = netdev_priv(dev); |
8618 | 8566 | |
8619 | 8567 | skb->protocol = eth_type_trans(skb, dev); |
8620 | - if (sp->vlgrp && vlan_tag && (sp->vlan_strip_flag)) { | |
8621 | - /* Queueing the vlan frame to the upper layer */ | |
8622 | - if (sp->config.napi) | |
8623 | - vlan_hwaccel_receive_skb(skb, sp->vlgrp, vlan_tag); | |
8624 | - else | |
8625 | - vlan_hwaccel_rx(skb, sp->vlgrp, vlan_tag); | |
8626 | - } else { | |
8627 | - if (sp->config.napi) | |
8628 | - netif_receive_skb(skb); | |
8629 | - else | |
8630 | - netif_rx(skb); | |
8631 | - } | |
8568 | + if (vlan_tag && sp->vlan_strip_flag) | |
8569 | + __vlan_hwaccel_put_tag(skb, vlan_tag); | |
8570 | + if (sp->config.napi) | |
8571 | + netif_receive_skb(skb); | |
8572 | + else | |
8573 | + netif_rx(skb); | |
8632 | 8574 | } |
8633 | 8575 | |
8634 | 8576 | static void lro_append_pkt(struct s2io_nic *sp, struct lro *lro, |