Deleted Added
sdiff udiff text old ( 170654 ) new ( 170869 )
full compact
1/**************************************************************************
2
3Copyright (c) 2007, Chelsio Inc.
4All rights reserved.
5
6Redistribution and use in source and binary forms, with or without
7modification, are permitted provided that the following conditions are met:
8

--- 12 unchanged lines hidden (view full) ---

21CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26POSSIBILITY OF SUCH DAMAGE.
27
28
29$FreeBSD: head/sys/dev/cxgb/cxgb_adapter.h 170654 2007-06-13 05:36:00Z kmacy $
30
31***************************************************************************/
32
33
34
35#ifndef _CXGB_ADAPTER_H_
36#define _CXGB_ADAPTER_H_
37
38#include <sys/cdefs.h>
39__FBSDID("$FreeBSD: head/sys/dev/cxgb/cxgb_adapter.h 170654 2007-06-13 05:36:00Z kmacy $");
40
41#include <sys/lock.h>
42#include <sys/mutex.h>
43#include <sys/rman.h>
44#include <sys/mbuf.h>
45#include <sys/socket.h>
46#include <sys/sockio.h>
47
48#include <net/ethernet.h>
49#include <net/if.h>
50#include <net/if_media.h>

--- 9 unchanged lines hidden (view full) ---

60#include <ulp/toecore/toedev.h>
61#include <sys/mbufq.h>
62#else
63#include <dev/cxgb/cxgb_osdep.h>
64#include <dev/cxgb/sys/mbufq.h>
65#include <dev/cxgb/ulp/toecore/toedev.h>
66#endif
67
68struct adapter;
69struct sge_qset;
70extern int cxgb_debug;
71
72struct port_info {
73 struct adapter *adapter;
74 struct ifnet *ifp;
75 int if_flags;
76 const struct port_type_info *port_type;
77 struct cphy phy;
78 struct cmac mac;
79 struct link_config link_config;
80 struct ifmedia media;
81 struct mtx lock;
82
83 int port;
84 uint8_t hw_addr[ETHER_ADDR_LEN];
85 uint8_t nqsets;
86 uint8_t first_qset;
87 struct taskqueue *tq;
88 struct task start_task;
89 struct task timer_reclaim_task;
90 struct cdev *port_cdev;
91};
92
93enum { /* adapter flags */
94 FULL_INIT_DONE = (1 << 0),
95 USING_MSI = (1 << 1),
96 USING_MSIX = (1 << 2),
97 QUEUES_BOUND = (1 << 3),
98 FW_UPTODATE = (1 << 4),
99};
100
101
102#define FL_Q_SIZE 4096
103#define JUMBO_Q_SIZE 512
104#define RSPQ_Q_SIZE 1024
105#define TX_ETH_Q_SIZE 1024
106
107/*
108 * Types of Tx queues in each queue set. Order here matters, do not change.
109 * XXX TOE is not implemented yet, so the extra queues are just placeholders.
110 */
111enum { TXQ_ETH, TXQ_OFLD, TXQ_CTRL };
112
113
114/* careful, the following are set on priv_flags and must not collide with

--- 45 unchanged lines hidden (view full) ---

160 uint32_t offload_bundles;
161 uint32_t pure_rsps;
162 uint32_t unhandled_irqs;
163
164 bus_addr_t phys_addr;
165 bus_dma_tag_t desc_tag;
166 bus_dmamap_t desc_map;
167 struct mbuf *m;
168};
169
170struct rx_desc;
171struct rx_sw_desc;
172
173struct sge_fl {
174 uint32_t buf_size;
175 uint32_t credits;

--- 35 unchanged lines hidden (view full) ---

211 uint32_t cntxt_id;
212 uint64_t stops;
213 uint64_t restarts;
214 bus_dma_tag_t desc_tag;
215 bus_dmamap_t desc_map;
216 bus_dma_tag_t entry_tag;
217 struct mbuf_head sendq;
218 struct mtx lock;
219};
220
221
222enum {
223 SGE_PSTAT_TSO, /* # of TSO requests */
224 SGE_PSTAT_RX_CSUM_GOOD, /* # of successful RX csum offloads */
225 SGE_PSTAT_TX_CSUM, /* # of TX checksum offloads */
226 SGE_PSTAT_VLANEX, /* # of VLAN tag extractions */

--- 28 unchanged lines hidden (view full) ---

255
256 /* PCI register resources */
257 uint32_t regs_rid;
258 struct resource *regs_res;
259 bus_space_handle_t bh;
260 bus_space_tag_t bt;
261 bus_size_t mmio_len;
262 uint32_t link_width;
263
264
265 /* DMA resources */
266 bus_dma_tag_t parent_dmat;
267 bus_dma_tag_t rx_dmat;
268 bus_dma_tag_t rx_jumbo_dmat;
269 bus_dma_tag_t tx_dmat;
270
271 /* Interrupt resources */

--- 6 unchanged lines hidden (view full) ---

278
279 struct resource *msix_irq_res[SGE_QSETS];
280 int msix_irq_rid[SGE_QSETS];
281 void *msix_intr_tag[SGE_QSETS];
282
283 /* Tasks */
284 struct task ext_intr_task;
285 struct task slow_intr_task;
286 struct task process_responses_task;
287 struct task mr_refresh_task;
288 struct taskqueue *tq;
289 struct callout cxgb_tick_ch;
290 struct callout sge_timer_ch;
291
292 /* Register lock for use by the hardware layer */
293 struct mtx mdio_lock;
294 struct mtx elmer_lock;
295

--- 9 unchanged lines hidden (view full) ---

305 struct mc5 mc5;
306
307 struct port_info port[MAX_NPORTS];
308 device_t portdev[MAX_NPORTS];
309 struct toedev tdev;
310 char fw_version[64];
311 uint32_t open_device_map;
312 uint32_t registered_device_map;
313 struct mtx lock;
314 driver_intr_t *cxgb_intr;
315 int msi_count;
316};
317
318struct t3_rx_mode {
319
320 uint32_t idx;
321 struct port_info *port;
322};
323
324
325#define MDIO_LOCK(adapter) mtx_lock(&(adapter)->mdio_lock)
326#define MDIO_UNLOCK(adapter) mtx_unlock(&(adapter)->mdio_lock)
327#define ELMR_LOCK(adapter) mtx_lock(&(adapter)->elmer_lock)
328#define ELMR_UNLOCK(adapter) mtx_unlock(&(adapter)->elmer_lock)
329
330#define PORT_LOCK(port) mtx_lock(&(port)->lock);
331#define PORT_UNLOCK(port) mtx_unlock(&(port)->lock);
332
333#define ADAPTER_LOCK(adap) mtx_lock(&(adap)->lock);
334#define ADAPTER_UNLOCK(adap) mtx_unlock(&(adap)->lock);
335
336
337
338static __inline uint32_t
339t3_read_reg(adapter_t *adapter, uint32_t reg_addr)
340{
341 return (bus_space_read_4(adapter->bt, adapter->bh, reg_addr));
342}
343
344static __inline void
345t3_write_reg(adapter_t *adapter, uint32_t reg_addr, uint32_t val)

--- 131 unchanged lines hidden ---