Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b85da2c0 authored by Jiri Pirko's avatar Jiri Pirko Committed by David S. Miller
Browse files

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: default avatarJiri Pirko <jpirko@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 18c49b91
Loading
Loading
Loading
Loading
+6 −64
Original line number Diff line number Diff line
@@ -356,56 +356,6 @@ static void do_s2io_copy_mac_addr(struct s2io_nic *sp, int offset, u64 mac_addr)
	sp->def_mac_addr[offset].mac_addr[0] = (u8) (mac_addr >> 40);
}

/* Add the vlan */
static void s2io_vlan_rx_register(struct net_device *dev,
				  struct vlan_group *grp)
{
	int i;
	struct s2io_nic *nic = netdev_priv(dev);
	unsigned long flags[MAX_TX_FIFOS];
	struct config_param *config = &nic->config;
	struct mac_info *mac_control = &nic->mac_control;

	for (i = 0; i < config->tx_fifo_num; i++) {
		struct fifo_info *fifo = &mac_control->fifos[i];

		spin_lock_irqsave(&fifo->tx_lock, flags[i]);
	}

	nic->vlgrp = grp;

	for (i = config->tx_fifo_num - 1; i >= 0; i--) {
		struct fifo_info *fifo = &mac_control->fifos[i];

		spin_unlock_irqrestore(&fifo->tx_lock, flags[i]);
	}
}

/* Unregister the vlan */
static void s2io_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid)
{
	int i;
	struct s2io_nic *nic = netdev_priv(dev);
	unsigned long flags[MAX_TX_FIFOS];
	struct config_param *config = &nic->config;
	struct mac_info *mac_control = &nic->mac_control;

	for (i = 0; i < config->tx_fifo_num; i++) {
		struct fifo_info *fifo = &mac_control->fifos[i];

		spin_lock_irqsave(&fifo->tx_lock, flags[i]);
	}

	if (nic->vlgrp)
		vlan_group_set_device(nic->vlgrp, vid, NULL);

	for (i = config->tx_fifo_num - 1; i >= 0; i--) {
		struct fifo_info *fifo = &mac_control->fifos[i];

		spin_unlock_irqrestore(&fifo->tx_lock, flags[i]);
	}
}

/*
 * Constants to be programmed into the Xena's registers, to configure
 * the XAUI.
@@ -7737,8 +7687,6 @@ static const struct net_device_ops s2io_netdev_ops = {
	.ndo_set_mac_address    = s2io_set_mac_addr,
	.ndo_change_mtu	   	= s2io_change_mtu,
	.ndo_set_features	= s2io_set_features,
	.ndo_vlan_rx_register   = s2io_vlan_rx_register,
	.ndo_vlan_rx_kill_vid   = s2io_vlan_rx_kill_vid,
	.ndo_tx_timeout	   	= s2io_tx_watchdog,
#ifdef CONFIG_NET_POLL_CONTROLLER
	.ndo_poll_controller    = s2io_netpoll,
@@ -8617,19 +8565,13 @@ static void queue_rx_frame(struct sk_buff *skb, u16 vlan_tag)
	struct s2io_nic *sp = netdev_priv(dev);

	skb->protocol = eth_type_trans(skb, dev);
	if (sp->vlgrp && vlan_tag && (sp->vlan_strip_flag)) {
		/* Queueing the vlan frame to the upper layer */
		if (sp->config.napi)
			vlan_hwaccel_receive_skb(skb, sp->vlgrp, vlan_tag);
		else
			vlan_hwaccel_rx(skb, sp->vlgrp, vlan_tag);
	} else {
	if (vlan_tag && sp->vlan_strip_flag)
		__vlan_hwaccel_put_tag(skb, vlan_tag);
	if (sp->config.napi)
		netif_receive_skb(skb);
	else
		netif_rx(skb);
}
}

static void lro_append_pkt(struct s2io_nic *sp, struct lro *lro,
			   struct sk_buff *skb, u32 tcp_len)
+0 −1
Original line number Diff line number Diff line
@@ -939,7 +939,6 @@ struct s2io_nic {

	int task_flag;
	unsigned long long start_time;
	struct vlan_group *vlgrp;
	int vlan_strip_flag;
#define MSIX_FLG                0xA5
	int num_entries;