Deleted Added
full compact
cxgb_adapter.h (170076) cxgb_adapter.h (170654)
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
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 170076 2007-05-28 22:57:27Z kmacy $
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>
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 170076 2007-05-28 22:57:27Z kmacy $");
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>
51
52#include <machine/bus.h>
53#include <machine/resource.h>
54#include <sys/bus_dma.h>
55#include <dev/pci/pcireg.h>
56#include <dev/pci/pcivar.h>
57
58#ifdef CONFIG_DEFINED
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>
51
52#include <machine/bus.h>
53#include <machine/resource.h>
54#include <sys/bus_dma.h>
55#include <dev/pci/pcireg.h>
56#include <dev/pci/pcivar.h>
57
58#ifdef CONFIG_DEFINED
59#include <cxgb_include.h>
59#include <cxgb_osdep.h>
60#include <ulp/toecore/toedev.h>
61#include <sys/mbufq.h>
60#else
62#else
61#include <dev/cxgb/cxgb_include.h>
63#include <dev/cxgb/cxgb_osdep.h>
64#include <dev/cxgb/sys/mbufq.h>
65#include <dev/cxgb/ulp/toecore/toedev.h>
62#endif
63
64struct adapter;
65struct sge_qset;
66extern int cxgb_debug;
67
68struct port_info {
69 struct adapter *adapter;

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

77 struct mtx lock;
78
79 int port;
80 uint8_t hw_addr[ETHER_ADDR_LEN];
81 uint8_t nqsets;
82 uint8_t first_qset;
83 struct taskqueue *tq;
84 struct task start_task;
66#endif
67
68struct adapter;
69struct sge_qset;
70extern int cxgb_debug;
71
72struct port_info {
73 struct adapter *adapter;

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

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;
85 struct cdev *port_cdev;
86};
87
88enum { /* adapter flags */
89 FULL_INIT_DONE = (1 << 0),
90 USING_MSI = (1 << 1),
91 USING_MSIX = (1 << 2),
92 QUEUES_BOUND = (1 << 3),

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

272 struct resource *msix_regs_res;
273
274 struct resource *msix_irq_res[SGE_QSETS];
275 int msix_irq_rid[SGE_QSETS];
276 void *msix_intr_tag[SGE_QSETS];
277
278 /* Tasks */
279 struct task ext_intr_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),

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

277 struct resource *msix_regs_res;
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;
280 struct task timer_reclaim_task;
281 struct task slow_intr_task;
282 struct task process_responses_task;
283 struct task mr_refresh_task;
284 struct taskqueue *tq;
285 struct callout cxgb_tick_ch;
286 struct callout sge_timer_ch;
287
288 /* Register lock for use by the hardware layer */
289 struct mtx mdio_lock;
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;
290
291 /* Bookkeeping for the hardware layer */
292 struct adapter_params params;
293 unsigned int slow_intr_mask;
294 unsigned long irq_stats[IRQ_NUM_STATS];
295
296 struct sge sge;
297 struct mc7 pmrx;

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

314
315 uint32_t idx;
316 struct port_info *port;
317};
318
319
320#define MDIO_LOCK(adapter) mtx_lock(&(adapter)->mdio_lock)
321#define MDIO_UNLOCK(adapter) mtx_unlock(&(adapter)->mdio_lock)
295
296 /* Bookkeeping for the hardware layer */
297 struct adapter_params params;
298 unsigned int slow_intr_mask;
299 unsigned long irq_stats[IRQ_NUM_STATS];
300
301 struct sge sge;
302 struct mc7 pmrx;

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

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)
322
323#define PORT_LOCK(port) mtx_lock(&(port)->lock);
324#define PORT_UNLOCK(port) mtx_unlock(&(port)->lock);
325
326#define ADAPTER_LOCK(adap) mtx_lock(&(adap)->lock);
327#define ADAPTER_UNLOCK(adap) mtx_unlock(&(adap)->lock);
328
329

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

408void t3_free_sge_resources(adapter_t *);
409void t3_sge_start(adapter_t *);
410void t3_sge_stop(adapter_t *);
411void t3b_intr(void *data);
412void t3_intr_msi(void *data);
413void t3_intr_msix(void *data);
414int t3_encap(struct port_info *, struct mbuf **);
415
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

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

415void t3_free_sge_resources(adapter_t *);
416void t3_sge_start(adapter_t *);
417void t3_sge_stop(adapter_t *);
418void t3b_intr(void *data);
419void t3_intr_msi(void *data);
420void t3_intr_msix(void *data);
421int t3_encap(struct port_info *, struct mbuf **);
422
416int t3_sge_init_sw(adapter_t *);
423int t3_sge_init_adapter(adapter_t *);
424int t3_sge_init_port(struct port_info *);
417void t3_sge_deinit_sw(adapter_t *);
418
419void t3_rx_eth_lro(adapter_t *adap, struct sge_rspq *rq, struct mbuf *m,
420 int ethpad, uint32_t rss_hash, uint32_t rss_csum, int lro);
421void t3_rx_eth(struct port_info *p, struct sge_rspq *rq, struct mbuf *m, int ethpad);
422void t3_lro_flush(adapter_t *adap, struct sge_qset *qs, struct lro_state *state);
423
424void t3_add_sysctls(adapter_t *sc);

--- 44 unchanged lines hidden ---
425void t3_sge_deinit_sw(adapter_t *);
426
427void t3_rx_eth_lro(adapter_t *adap, struct sge_rspq *rq, struct mbuf *m,
428 int ethpad, uint32_t rss_hash, uint32_t rss_csum, int lro);
429void t3_rx_eth(struct port_info *p, struct sge_rspq *rq, struct mbuf *m, int ethpad);
430void t3_lro_flush(adapter_t *adap, struct sge_qset *qs, struct lro_state *state);
431
432void t3_add_sysctls(adapter_t *sc);

--- 44 unchanged lines hidden ---