diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/s2io.c | 31 | ||||
-rw-r--r-- | drivers/net/s2io.h | 6 |
2 files changed, 2 insertions, 35 deletions
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c index 4344e6ed9041..157fd932e951 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. |
diff --git a/drivers/net/s2io.h b/drivers/net/s2io.h index e3136cfd6db2..ce53a02105f2 100644 --- a/drivers/net/s2io.h +++ b/drivers/net/s2io.h | |||
@@ -703,9 +703,6 @@ struct ring_info { | |||
703 | */ | 703 | */ |
704 | struct rx_curr_get_info rx_curr_get_info; | 704 | struct rx_curr_get_info rx_curr_get_info; |
705 | 705 | ||
706 | /* Index to the absolute position of the put pointer of Rx ring */ | ||
707 | int put_pos; | ||
708 | |||
709 | /* Buffer Address store. */ | 706 | /* Buffer Address store. */ |
710 | struct buffAdd **ba; | 707 | struct buffAdd **ba; |
711 | struct s2io_nic *nic; | 708 | struct s2io_nic *nic; |
@@ -877,8 +874,6 @@ struct s2io_nic { | |||
877 | 874 | ||
878 | atomic_t rx_bufs_left[MAX_RX_RINGS]; | 875 | atomic_t rx_bufs_left[MAX_RX_RINGS]; |
879 | 876 | ||
880 | spinlock_t put_lock; | ||
881 | |||
882 | #define PROMISC 1 | 877 | #define PROMISC 1 |
883 | #define ALL_MULTI 2 | 878 | #define ALL_MULTI 2 |
884 | 879 | ||
@@ -962,7 +957,6 @@ struct s2io_nic { | |||
962 | u8 lro; | 957 | u8 lro; |
963 | u16 lro_max_aggr_per_sess; | 958 | u16 lro_max_aggr_per_sess; |
964 | volatile unsigned long state; | 959 | volatile unsigned long state; |
965 | spinlock_t rx_lock; | ||
966 | u64 general_int_mask; | 960 | u64 general_int_mask; |
967 | #define VPD_STRING_LEN 80 | 961 | #define VPD_STRING_LEN 80 |
968 | u8 product_name[VPD_STRING_LEN]; | 962 | u8 product_name[VPD_STRING_LEN]; |