Deleted Added
full compact
cxgb_adapter.h (175374) cxgb_adapter.h (176472)
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 175374 2008-01-16 00:26:04Z kmacy $
29$FreeBSD: head/sys/dev/cxgb/cxgb_adapter.h 176472 2008-02-23 01:06:17Z kmacy $
30
31***************************************************************************/
32
33
34#ifndef _CXGB_ADAPTER_H_
35#define _CXGB_ADAPTER_H_
36
37#include <sys/lock.h>
38#include <sys/mutex.h>
39#include <sys/sx.h>
40#include <sys/rman.h>
41#include <sys/mbuf.h>
42#include <sys/socket.h>
43#include <sys/sockio.h>
44#include <sys/condvar.h>
45
46#include <net/ethernet.h>
47#include <net/if.h>
48#include <net/if_media.h>
30
31***************************************************************************/
32
33
34#ifndef _CXGB_ADAPTER_H_
35#define _CXGB_ADAPTER_H_
36
37#include <sys/lock.h>
38#include <sys/mutex.h>
39#include <sys/sx.h>
40#include <sys/rman.h>
41#include <sys/mbuf.h>
42#include <sys/socket.h>
43#include <sys/sockio.h>
44#include <sys/condvar.h>
45
46#include <net/ethernet.h>
47#include <net/if.h>
48#include <net/if_media.h>
49#include <net/if_dl.h>
49
50#include <machine/bus.h>
51#include <machine/resource.h>
52
53#include <sys/bus_dma.h>
54#include <dev/pci/pcireg.h>
55#include <dev/pci/pcivar.h>
56
50
51#include <machine/bus.h>
52#include <machine/resource.h>
53
54#include <sys/bus_dma.h>
55#include <dev/pci/pcireg.h>
56#include <dev/pci/pcivar.h>
57
58
57#ifdef CONFIG_DEFINED
58#include <cxgb_osdep.h>
59#include <t3cdev.h>
60#include <ulp/toecore/cxgb_toedev.h>
61#include <sys/mbufq.h>
62#else
63#include <dev/cxgb/cxgb_osdep.h>
64#include <dev/cxgb/t3cdev.h>

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

139
140enum { /* adapter flags */
141 FULL_INIT_DONE = (1 << 0),
142 USING_MSI = (1 << 1),
143 USING_MSIX = (1 << 2),
144 QUEUES_BOUND = (1 << 3),
145 FW_UPTODATE = (1 << 4),
146 TPS_UPTODATE = (1 << 5),
59#ifdef CONFIG_DEFINED
60#include <cxgb_osdep.h>
61#include <t3cdev.h>
62#include <ulp/toecore/cxgb_toedev.h>
63#include <sys/mbufq.h>
64#else
65#include <dev/cxgb/cxgb_osdep.h>
66#include <dev/cxgb/t3cdev.h>

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

141
142enum { /* adapter flags */
143 FULL_INIT_DONE = (1 << 0),
144 USING_MSI = (1 << 1),
145 USING_MSIX = (1 << 2),
146 QUEUES_BOUND = (1 << 3),
147 FW_UPTODATE = (1 << 4),
148 TPS_UPTODATE = (1 << 5),
149 CXGB_SHUTDOWN = (1 << 6),
150 CXGB_OFLD_INIT = (1 << 7),
151 TP_PARITY_INIT = (1 << 8),
147};
148
149#define FL_Q_SIZE 4096
150#define JUMBO_Q_SIZE 1024
151#define RSPQ_Q_SIZE 1024
152#define TX_ETH_Q_SIZE 1024
153
154enum { TXQ_ETH = 0,

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

198 uint32_t credits;
199 uint32_t size;
200 uint32_t cidx;
201 uint32_t gen;
202 uint32_t polling;
203 uint32_t holdoff_tmr;
204 uint32_t next_holdoff;
205 uint32_t imm_data;
152};
153
154#define FL_Q_SIZE 4096
155#define JUMBO_Q_SIZE 1024
156#define RSPQ_Q_SIZE 1024
157#define TX_ETH_Q_SIZE 1024
158
159enum { TXQ_ETH = 0,

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

203 uint32_t credits;
204 uint32_t size;
205 uint32_t cidx;
206 uint32_t gen;
207 uint32_t polling;
208 uint32_t holdoff_tmr;
209 uint32_t next_holdoff;
210 uint32_t imm_data;
211 uint32_t async_notif;
206 uint32_t cntxt_id;
207 uint32_t offload_pkts;
208 uint32_t offload_bundles;
209 uint32_t pure_rsps;
210 uint32_t unhandled_irqs;
211
212 bus_addr_t phys_addr;
213 bus_dma_tag_t desc_tag;

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

343struct adapter {
344 device_t dev;
345 int flags;
346 TAILQ_ENTRY(adapter) adapter_entry;
347
348 /* PCI register resources */
349 int regs_rid;
350 struct resource *regs_res;
212 uint32_t cntxt_id;
213 uint32_t offload_pkts;
214 uint32_t offload_bundles;
215 uint32_t pure_rsps;
216 uint32_t unhandled_irqs;
217
218 bus_addr_t phys_addr;
219 bus_dma_tag_t desc_tag;

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

349struct adapter {
350 device_t dev;
351 int flags;
352 TAILQ_ENTRY(adapter) adapter_entry;
353
354 /* PCI register resources */
355 int regs_rid;
356 struct resource *regs_res;
357 int udbs_rid;
358 struct resource *udbs_res;
351 bus_space_handle_t bh;
352 bus_space_tag_t bt;
353 bus_size_t mmio_len;
354 uint32_t link_width;
355
356 /* DMA resources */
357 bus_dma_tag_t parent_dmat;
358 bus_dma_tag_t rx_dmat;

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

503{
504 pci_write_config(adapter->dev, reg, val, 2);
505}
506
507static __inline uint8_t *
508t3_get_next_mcaddr(struct t3_rx_mode *rm)
509{
510 uint8_t *macaddr = NULL;
359 bus_space_handle_t bh;
360 bus_space_tag_t bt;
361 bus_size_t mmio_len;
362 uint32_t link_width;
363
364 /* DMA resources */
365 bus_dma_tag_t parent_dmat;
366 bus_dma_tag_t rx_dmat;

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

511{
512 pci_write_config(adapter->dev, reg, val, 2);
513}
514
515static __inline uint8_t *
516t3_get_next_mcaddr(struct t3_rx_mode *rm)
517{
518 uint8_t *macaddr = NULL;
511
512 if (rm->idx == 0)
513 macaddr = (uint8_t *)rm->port->hw_addr;
519 struct ifnet *ifp = rm->port->ifp;
520 struct ifmultiaddr *ifma;
521 int i = 0;
514
522
523 IF_ADDR_LOCK(ifp);
524 TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
525 if (ifma->ifma_addr->sa_family != AF_LINK)
526 continue;
527 if (i == rm->idx) {
528 macaddr = LLADDR((struct sockaddr_dl *)ifma->ifma_addr);
529 break;
530 }
531 i++;
532 }
533 IF_ADDR_UNLOCK(ifp);
534
535
515 rm->idx++;
516 return (macaddr);
517}
518
519static __inline void
520t3_init_rx_mode(struct t3_rx_mode *rm, struct port_info *port)
521{
522 rm->idx = 0;

--- 99 unchanged lines hidden ---
536 rm->idx++;
537 return (macaddr);
538}
539
540static __inline void
541t3_init_rx_mode(struct t3_rx_mode *rm, struct port_info *port)
542{
543 rm->idx = 0;

--- 99 unchanged lines hidden ---