aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/qlcnic/qlcnic_init.c
diff options
context:
space:
mode:
authorAnirban Chakraborty <anirban.chakraborty@qlogic.com>2011-04-01 10:28:05 -0400
committerDavid S. Miller <davem@davemloft.net>2011-04-06 15:47:11 -0400
commitb1fc6d3cfaff6fefd838b84532cb356f8a80da7b (patch)
treecb453fc6ff25043aac738d84a56a9fd65a8715eb /drivers/net/qlcnic/qlcnic_init.c
parentf848d6dd10e8e27d5dd61a8ab7174a7dde3a3db5 (diff)
qlcnic: Cleanup patch
1. Changed adapter structure to move away from embedding hardware and receive context structs and use pointers to those objects 2. Packed all the structs that interface with FW 3. Removed unused code and structs Signed-off-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/qlcnic/qlcnic_init.c')
-rw-r--r--drivers/net/qlcnic/qlcnic_init.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/drivers/net/qlcnic/qlcnic_init.c b/drivers/net/qlcnic/qlcnic_init.c
index a7f1d5b7e811..476ea14c0ff3 100644
--- a/drivers/net/qlcnic/qlcnic_init.c
+++ b/drivers/net/qlcnic/qlcnic_init.c
@@ -94,7 +94,7 @@ void qlcnic_release_rx_buffers(struct qlcnic_adapter *adapter)
94 struct qlcnic_rx_buffer *rx_buf; 94 struct qlcnic_rx_buffer *rx_buf;
95 int i, ring; 95 int i, ring;
96 96
97 recv_ctx = &adapter->recv_ctx; 97 recv_ctx = adapter->recv_ctx;
98 for (ring = 0; ring < adapter->max_rds_rings; ring++) { 98 for (ring = 0; ring < adapter->max_rds_rings; ring++) {
99 rds_ring = &recv_ctx->rds_rings[ring]; 99 rds_ring = &recv_ctx->rds_rings[ring];
100 for (i = 0; i < rds_ring->num_desc; ++i) { 100 for (i = 0; i < rds_ring->num_desc; ++i) {
@@ -119,7 +119,7 @@ void qlcnic_reset_rx_buffers_list(struct qlcnic_adapter *adapter)
119 struct qlcnic_rx_buffer *rx_buf; 119 struct qlcnic_rx_buffer *rx_buf;
120 int i, ring; 120 int i, ring;
121 121
122 recv_ctx = &adapter->recv_ctx; 122 recv_ctx = adapter->recv_ctx;
123 for (ring = 0; ring < adapter->max_rds_rings; ring++) { 123 for (ring = 0; ring < adapter->max_rds_rings; ring++) {
124 rds_ring = &recv_ctx->rds_rings[ring]; 124 rds_ring = &recv_ctx->rds_rings[ring];
125 125
@@ -173,7 +173,7 @@ void qlcnic_free_sw_resources(struct qlcnic_adapter *adapter)
173 struct qlcnic_host_tx_ring *tx_ring; 173 struct qlcnic_host_tx_ring *tx_ring;
174 int ring; 174 int ring;
175 175
176 recv_ctx = &adapter->recv_ctx; 176 recv_ctx = adapter->recv_ctx;
177 177
178 if (recv_ctx->rds_rings == NULL) 178 if (recv_ctx->rds_rings == NULL)
179 goto skip_rds; 179 goto skip_rds;
@@ -226,7 +226,7 @@ int qlcnic_alloc_sw_resources(struct qlcnic_adapter *adapter)
226 } 226 }
227 tx_ring->cmd_buf_arr = cmd_buf_arr; 227 tx_ring->cmd_buf_arr = cmd_buf_arr;
228 228
229 recv_ctx = &adapter->recv_ctx; 229 recv_ctx = adapter->recv_ctx;
230 230
231 size = adapter->max_rds_rings * sizeof(struct qlcnic_host_rds_ring); 231 size = adapter->max_rds_rings * sizeof(struct qlcnic_host_rds_ring);
232 rds_ring = kzalloc(size, GFP_KERNEL); 232 rds_ring = kzalloc(size, GFP_KERNEL);
@@ -864,7 +864,7 @@ nomn:
864 for (i = 0; i < entries; i++) { 864 for (i = 0; i < entries; i++) {
865 865
866 __le32 flags, file_chiprev, offs; 866 __le32 flags, file_chiprev, offs;
867 u8 chiprev = adapter->ahw.revision_id; 867 u8 chiprev = adapter->ahw->revision_id;
868 u32 flagbit; 868 u32 flagbit;
869 869
870 offs = cpu_to_le32(ptab_descr->findex) + 870 offs = cpu_to_le32(ptab_descr->findex) +
@@ -1394,7 +1394,7 @@ static struct sk_buff *qlcnic_process_rxbuf(struct qlcnic_adapter *adapter,
1394 return skb; 1394 return skb;
1395} 1395}
1396 1396
1397static int 1397static inline int
1398qlcnic_check_rx_tagging(struct qlcnic_adapter *adapter, struct sk_buff *skb, 1398qlcnic_check_rx_tagging(struct qlcnic_adapter *adapter, struct sk_buff *skb,
1399 u16 *vlan_tag) 1399 u16 *vlan_tag)
1400{ 1400{
@@ -1425,7 +1425,7 @@ qlcnic_process_rcv(struct qlcnic_adapter *adapter,
1425 int ring, u64 sts_data0) 1425 int ring, u64 sts_data0)
1426{ 1426{
1427 struct net_device *netdev = adapter->netdev; 1427 struct net_device *netdev = adapter->netdev;
1428 struct qlcnic_recv_context *recv_ctx = &adapter->recv_ctx; 1428 struct qlcnic_recv_context *recv_ctx = adapter->recv_ctx;
1429 struct qlcnic_rx_buffer *buffer; 1429 struct qlcnic_rx_buffer *buffer;
1430 struct sk_buff *skb; 1430 struct sk_buff *skb;
1431 struct qlcnic_host_rds_ring *rds_ring; 1431 struct qlcnic_host_rds_ring *rds_ring;
@@ -1488,7 +1488,7 @@ qlcnic_process_lro(struct qlcnic_adapter *adapter,
1488 int ring, u64 sts_data0, u64 sts_data1) 1488 int ring, u64 sts_data0, u64 sts_data1)
1489{ 1489{
1490 struct net_device *netdev = adapter->netdev; 1490 struct net_device *netdev = adapter->netdev;
1491 struct qlcnic_recv_context *recv_ctx = &adapter->recv_ctx; 1491 struct qlcnic_recv_context *recv_ctx = adapter->recv_ctx;
1492 struct qlcnic_rx_buffer *buffer; 1492 struct qlcnic_rx_buffer *buffer;
1493 struct sk_buff *skb; 1493 struct sk_buff *skb;
1494 struct qlcnic_host_rds_ring *rds_ring; 1494 struct qlcnic_host_rds_ring *rds_ring;
@@ -1625,7 +1625,7 @@ skip:
1625 1625
1626 for (ring = 0; ring < adapter->max_rds_rings; ring++) { 1626 for (ring = 0; ring < adapter->max_rds_rings; ring++) {
1627 struct qlcnic_host_rds_ring *rds_ring = 1627 struct qlcnic_host_rds_ring *rds_ring =
1628 &adapter->recv_ctx.rds_rings[ring]; 1628 &adapter->recv_ctx->rds_rings[ring];
1629 1629
1630 if (!list_empty(&sds_ring->free_list[ring])) { 1630 if (!list_empty(&sds_ring->free_list[ring])) {
1631 list_for_each(cur, &sds_ring->free_list[ring]) { 1631 list_for_each(cur, &sds_ring->free_list[ring]) {
@@ -1651,12 +1651,13 @@ skip:
1651} 1651}
1652 1652
1653void 1653void
1654qlcnic_post_rx_buffers(struct qlcnic_adapter *adapter, u32 ringid, 1654qlcnic_post_rx_buffers(struct qlcnic_adapter *adapter,
1655 struct qlcnic_host_rds_ring *rds_ring) 1655 struct qlcnic_host_rds_ring *rds_ring)
1656{ 1656{
1657 struct rcv_desc *pdesc; 1657 struct rcv_desc *pdesc;
1658 struct qlcnic_rx_buffer *buffer; 1658 struct qlcnic_rx_buffer *buffer;
1659 int producer, count = 0; 1659 int count = 0;
1660 u32 producer;
1660 struct list_head *head; 1661 struct list_head *head;
1661 1662
1662 producer = rds_ring->producer; 1663 producer = rds_ring->producer;
@@ -1696,7 +1697,8 @@ qlcnic_post_rx_buffers_nodb(struct qlcnic_adapter *adapter,
1696{ 1697{
1697 struct rcv_desc *pdesc; 1698 struct rcv_desc *pdesc;
1698 struct qlcnic_rx_buffer *buffer; 1699 struct qlcnic_rx_buffer *buffer;
1699 int producer, count = 0; 1700 int count = 0;
1701 uint32_t producer;
1700 struct list_head *head; 1702 struct list_head *head;
1701 1703
1702 if (!spin_trylock(&rds_ring->lock)) 1704 if (!spin_trylock(&rds_ring->lock))