aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/benet/be.h
diff options
context:
space:
mode:
authorSathya Perla <sathyap@serverengines.com>2009-07-27 18:52:03 -0400
committerDavid S. Miller <davem@davemloft.net>2009-08-02 02:06:20 -0400
commit8788fdc2a53cf012a43808877eaa6ac7e3c923b4 (patch)
treeef62e30494ee1aaced18250ddb7295ff0bb28f7a /drivers/net/benet/be.h
parent2f6d7c1b34403b97fa57473edcb6749d1db5ace3 (diff)
be2net: get rid of be_ctrl_info struct/abstraction
Currently only the be_ctrl_info struct ptr (instead of adapter) is passed to all the routines in be_cmds.c. Instead pass be_adapter ptr to allow access to all its fields. Merge the contents of struct be_ctrl_info into be_adapter. The resulting code is simpler. Signed-off-by: Sathya Perla <sathyap@serverengines.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/benet/be.h')
-rw-r--r--drivers/net/benet/be.h47
1 files changed, 18 insertions, 29 deletions
diff --git a/drivers/net/benet/be.h b/drivers/net/benet/be.h
index 41cddbedbf2b..d8a157f8caf4 100644
--- a/drivers/net/benet/be.h
+++ b/drivers/net/benet/be.h
@@ -71,6 +71,8 @@ static inline char *nic_name(struct pci_dev *pdev)
71#define MAX_RX_POST BE_NAPI_WEIGHT /* Frags posted at a time */ 71#define MAX_RX_POST BE_NAPI_WEIGHT /* Frags posted at a time */
72#define RX_FRAGS_REFILL_WM (RX_Q_LEN - MAX_RX_POST) 72#define RX_FRAGS_REFILL_WM (RX_Q_LEN - MAX_RX_POST)
73 73
74#define FW_VER_LEN 32
75
74struct be_dma_mem { 76struct be_dma_mem {
75 void *va; 77 void *va;
76 dma_addr_t dma; 78 dma_addr_t dma;
@@ -123,7 +125,6 @@ static inline void queue_tail_inc(struct be_queue_info *q)
123 index_inc(&q->tail, q->len); 125 index_inc(&q->tail, q->len);
124} 126}
125 127
126
127struct be_eq_obj { 128struct be_eq_obj {
128 struct be_queue_info q; 129 struct be_queue_info q;
129 char desc[32]; 130 char desc[32];
@@ -142,31 +143,6 @@ struct be_mcc_obj {
142 struct be_queue_info cq; 143 struct be_queue_info cq;
143}; 144};
144 145
145struct be_ctrl_info {
146 u8 __iomem *csr;
147 u8 __iomem *db; /* Door Bell */
148 u8 __iomem *pcicfg; /* PCI config space */
149 int pci_func;
150
151 /* Mbox used for cmd request/response */
152 spinlock_t mbox_lock; /* For serializing mbox cmds to BE card */
153 struct be_dma_mem mbox_mem;
154 /* Mbox mem is adjusted to align to 16 bytes. The allocated addr
155 * is stored for freeing purpose */
156 struct be_dma_mem mbox_mem_alloced;
157
158 /* MCC Rings */
159 struct be_mcc_obj mcc_obj;
160 spinlock_t mcc_lock; /* For serializing mcc cmds to BE card */
161 spinlock_t mcc_cq_lock;
162
163 /* MCC Async callback */
164 void (*async_cb)(void *adapter, bool link_up);
165 void *adapter_ctxt;
166};
167
168#include "be_cmds.h"
169
170struct be_drvr_stats { 146struct be_drvr_stats {
171 u32 be_tx_reqs; /* number of TX requests initiated */ 147 u32 be_tx_reqs; /* number of TX requests initiated */
172 u32 be_tx_stops; /* number of times TX Q was stopped */ 148 u32 be_tx_stops; /* number of times TX Q was stopped */
@@ -234,8 +210,20 @@ struct be_adapter {
234 struct pci_dev *pdev; 210 struct pci_dev *pdev;
235 struct net_device *netdev; 211 struct net_device *netdev;
236 212
237 /* Mbox, pci config, csr address information */ 213 u8 __iomem *csr;
238 struct be_ctrl_info ctrl; 214 u8 __iomem *db; /* Door Bell */
215 u8 __iomem *pcicfg; /* PCI config space */
216 int pci_func;
217
218 spinlock_t mbox_lock; /* For serializing mbox cmds to BE card */
219 struct be_dma_mem mbox_mem;
220 /* Mbox mem is adjusted to align to 16 bytes. The allocated addr
221 * is stored for freeing purpose */
222 struct be_dma_mem mbox_mem_alloced;
223
224 struct be_mcc_obj mcc_obj;
225 spinlock_t mcc_lock; /* For serializing mcc cmds to BE card */
226 spinlock_t mcc_cq_lock;
239 227
240 struct msix_entry msix_entries[BE_NUM_MSIX_VECTORS]; 228 struct msix_entry msix_entries[BE_NUM_MSIX_VECTORS];
241 bool msix_enabled; 229 bool msix_enabled;
@@ -366,6 +354,7 @@ static inline u8 is_udp_pkt(struct sk_buff *skb)
366 return val; 354 return val;
367} 355}
368 356
369extern void be_cq_notify(struct be_ctrl_info *ctrl, u16 qid, bool arm, 357extern void be_cq_notify(struct be_adapter *adapter, u16 qid, bool arm,
370 u16 num_popped); 358 u16 num_popped);
359extern void be_link_status_update(struct be_adapter *adapter, bool link_up);
371#endif /* BE_H */ 360#endif /* BE_H */