aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/s2io.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/s2io.c')
-rw-r--r--drivers/net/s2io.c31
1 files changed, 2 insertions, 29 deletions
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c
index 4344e6ed904..157fd932e95 100644
--- a/drivers/net/s2io.c
+++ b/drivers/net/s2io.c
@@ -2530,7 +2530,6 @@ static int fill_rx_buffers(struct s2io_nic *nic, int ring_no)
2530 struct config_param *config; 2530 struct config_param *config;
2531 u64 tmp; 2531 u64 tmp;
2532 struct buffAdd *ba; 2532 struct buffAdd *ba;
2533 unsigned long flags;
2534 struct RxD_t *first_rxdp = NULL; 2533 struct RxD_t *first_rxdp = NULL;
2535 u64 Buffer0_ptr = 0, Buffer1_ptr = 0; 2534 u64 Buffer0_ptr = 0, Buffer1_ptr = 0;
2536 struct RxD1 *rxdp1; 2535 struct RxD1 *rxdp1;
@@ -2578,15 +2577,7 @@ static int fill_rx_buffers(struct s2io_nic *nic, int ring_no)
2578 DBG_PRINT(INTR_DBG, "%s: Next block at: %p\n", 2577 DBG_PRINT(INTR_DBG, "%s: Next block at: %p\n",
2579 dev->name, rxdp); 2578 dev->name, rxdp);
2580 } 2579 }
2581 if(!napi) { 2580
2582 spin_lock_irqsave(&nic->put_lock, flags);
2583 mac_control->rings[ring_no].put_pos =
2584 (block_no * (rxd_count[nic->rxd_mode] + 1)) + off;
2585 spin_unlock_irqrestore(&nic->put_lock, flags);
2586 } else {
2587 mac_control->rings[ring_no].put_pos =
2588 (block_no * (rxd_count[nic->rxd_mode] + 1)) + off;
2589 }
2590 if ((rxdp->Control_1 & RXD_OWN_XENA) && 2581 if ((rxdp->Control_1 & RXD_OWN_XENA) &&
2591 ((nic->rxd_mode == RXD_MODE_3B) && 2582 ((nic->rxd_mode == RXD_MODE_3B) &&
2592 (rxdp->Control_2 & s2BIT(0)))) { 2583 (rxdp->Control_2 & s2BIT(0)))) {
@@ -2964,7 +2955,7 @@ static void rx_intr_handler(struct ring_info *ring_data)
2964{ 2955{
2965 struct s2io_nic *nic = ring_data->nic; 2956 struct s2io_nic *nic = ring_data->nic;
2966 struct net_device *dev = (struct net_device *) nic->dev; 2957 struct net_device *dev = (struct net_device *) nic->dev;
2967 int get_block, put_block, put_offset; 2958 int get_block, put_block;
2968 struct rx_curr_get_info get_info, put_info; 2959 struct rx_curr_get_info get_info, put_info;
2969 struct RxD_t *rxdp; 2960 struct RxD_t *rxdp;
2970 struct sk_buff *skb; 2961 struct sk_buff *skb;
@@ -2973,19 +2964,11 @@ static void rx_intr_handler(struct ring_info *ring_data)
2973 struct RxD1* rxdp1; 2964 struct RxD1* rxdp1;
2974 struct RxD3* rxdp3; 2965 struct RxD3* rxdp3;
2975 2966
2976 spin_lock(&nic->rx_lock);
2977
2978 get_info = ring_data->rx_curr_get_info; 2967 get_info = ring_data->rx_curr_get_info;
2979 get_block = get_info.block_index; 2968 get_block = get_info.block_index;
2980 memcpy(&put_info, &ring_data->rx_curr_put_info, sizeof(put_info)); 2969 memcpy(&put_info, &ring_data->rx_curr_put_info, sizeof(put_info));
2981 put_block = put_info.block_index; 2970 put_block = put_info.block_index;
2982 rxdp = ring_data->rx_blocks[get_block].rxds[get_info.offset].virt_addr; 2971 rxdp = ring_data->rx_blocks[get_block].rxds[get_info.offset].virt_addr;
2983 if (!napi) {
2984 spin_lock(&nic->put_lock);
2985 put_offset = ring_data->put_pos;
2986 spin_unlock(&nic->put_lock);
2987 } else
2988 put_offset = ring_data->put_pos;
2989 2972
2990 while (RXD_IS_UP2DT(rxdp)) { 2973 while (RXD_IS_UP2DT(rxdp)) {
2991 /* 2974 /*
@@ -3002,7 +2985,6 @@ static void rx_intr_handler(struct ring_info *ring_data)
3002 DBG_PRINT(ERR_DBG, "%s: The skb is ", 2985 DBG_PRINT(ERR_DBG, "%s: The skb is ",
3003 dev->name); 2986 dev->name);
3004 DBG_PRINT(ERR_DBG, "Null in Rx Intr\n"); 2987 DBG_PRINT(ERR_DBG, "Null in Rx Intr\n");
3005 spin_unlock(&nic->rx_lock);
3006 return; 2988 return;
3007 } 2989 }
3008 if (nic->rxd_mode == RXD_MODE_1) { 2990 if (nic->rxd_mode == RXD_MODE_1) {
@@ -3058,8 +3040,6 @@ static void rx_intr_handler(struct ring_info *ring_data)
3058 } 3040 }
3059 } 3041 }
3060 } 3042 }
3061
3062 spin_unlock(&nic->rx_lock);
3063} 3043}
3064 3044
3065/** 3045/**
@@ -7083,7 +7063,6 @@ static void do_s2io_card_down(struct s2io_nic * sp, int do_io)
7083{ 7063{
7084 int cnt = 0; 7064 int cnt = 0;
7085 struct XENA_dev_config __iomem *bar0 = sp->bar0; 7065 struct XENA_dev_config __iomem *bar0 = sp->bar0;
7086 unsigned long flags;
7087 register u64 val64 = 0; 7066 register u64 val64 = 0;
7088 struct config_param *config; 7067 struct config_param *config;
7089 config = &sp->config; 7068 config = &sp->config;
@@ -7142,9 +7121,7 @@ static void do_s2io_card_down(struct s2io_nic * sp, int do_io)
7142 free_tx_buffers(sp); 7121 free_tx_buffers(sp);
7143 7122
7144 /* Free all Rx buffers */ 7123 /* Free all Rx buffers */
7145 spin_lock_irqsave(&sp->rx_lock, flags);
7146 free_rx_buffers(sp); 7124 free_rx_buffers(sp);
7147 spin_unlock_irqrestore(&sp->rx_lock, flags);
7148 7125
7149 clear_bit(__S2IO_STATE_LINK_TASK, &(sp->state)); 7126 clear_bit(__S2IO_STATE_LINK_TASK, &(sp->state));
7150} 7127}
@@ -8044,10 +8021,6 @@ s2io_init_nic(struct pci_dev *pdev, const struct pci_device_id *pre)
8044 for (i = 0; i < sp->config.tx_fifo_num; i++) 8021 for (i = 0; i < sp->config.tx_fifo_num; i++)
8045 spin_lock_init(&mac_control->fifos[i].tx_lock); 8022 spin_lock_init(&mac_control->fifos[i].tx_lock);
8046 8023
8047 if (!napi)
8048 spin_lock_init(&sp->put_lock);
8049 spin_lock_init(&sp->rx_lock);
8050
8051 /* 8024 /*
8052 * SXE-002: Configure link and activity LED to init state 8025 * SXE-002: Configure link and activity LED to init state
8053 * on driver load. 8026 * on driver load.