cxgb_main.c (172147) | cxgb_main.c (174626) |
---|---|
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 --- 14 unchanged lines hidden (view full) --- 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 30#include <sys/cdefs.h> | 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 --- 14 unchanged lines hidden (view full) --- 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 30#include <sys/cdefs.h> |
31__FBSDID("$FreeBSD: head/sys/dev/cxgb/cxgb_main.c 172147 2007-09-11 23:49:27Z kmacy $"); | 31__FBSDID("$FreeBSD: head/sys/dev/cxgb/cxgb_main.c 174626 2007-12-15 21:54:59Z kmacy $"); |
32 33#include <sys/param.h> 34#include <sys/systm.h> 35#include <sys/kernel.h> 36#include <sys/bus.h> 37#include <sys/module.h> 38#include <sys/pciio.h> 39#include <sys/conf.h> 40#include <machine/bus.h> 41#include <machine/resource.h> 42#include <sys/bus_dma.h> 43#include <sys/rman.h> 44#include <sys/ioccom.h> 45#include <sys/mbuf.h> 46#include <sys/linker.h> | 32 33#include <sys/param.h> 34#include <sys/systm.h> 35#include <sys/kernel.h> 36#include <sys/bus.h> 37#include <sys/module.h> 38#include <sys/pciio.h> 39#include <sys/conf.h> 40#include <machine/bus.h> 41#include <machine/resource.h> 42#include <sys/bus_dma.h> 43#include <sys/rman.h> 44#include <sys/ioccom.h> 45#include <sys/mbuf.h> 46#include <sys/linker.h> |
47#include <sys/syslog.h> |
|
47#include <sys/firmware.h> 48#include <sys/socket.h> 49#include <sys/sockio.h> 50#include <sys/smp.h> 51#include <sys/sysctl.h> 52#include <sys/queue.h> 53#include <sys/taskqueue.h> 54 --- 56 unchanged lines hidden (view full) --- 111static __inline void reg_block_dump(struct adapter *ap, uint8_t *buf, unsigned int start, 112 unsigned int end); 113static void cxgb_get_regs(adapter_t *sc, struct ifconf_regs *regs, uint8_t *buf); 114static int cxgb_get_regs_len(void); 115static int offload_open(struct port_info *pi); 116static void touch_bars(device_t dev); 117 118#ifdef notyet | 48#include <sys/firmware.h> 49#include <sys/socket.h> 50#include <sys/sockio.h> 51#include <sys/smp.h> 52#include <sys/sysctl.h> 53#include <sys/queue.h> 54#include <sys/taskqueue.h> 55 --- 56 unchanged lines hidden (view full) --- 112static __inline void reg_block_dump(struct adapter *ap, uint8_t *buf, unsigned int start, 113 unsigned int end); 114static void cxgb_get_regs(adapter_t *sc, struct ifconf_regs *regs, uint8_t *buf); 115static int cxgb_get_regs_len(void); 116static int offload_open(struct port_info *pi); 117static void touch_bars(device_t dev); 118 119#ifdef notyet |
119static int offload_close(struct toedev *tdev); | 120static int offload_close(struct t3cdev *tdev); |
120#endif 121 122 123static device_method_t cxgb_controller_methods[] = { 124 DEVMETHOD(device_probe, cxgb_controller_probe), 125 DEVMETHOD(device_attach, cxgb_controller_attach), 126 DEVMETHOD(device_detach, cxgb_controller_detach), 127 --- 1102 unchanged lines hidden (view full) --- 1230 1231} 1232 1233/* 1234 * Sends an mbuf to an offload queue driver 1235 * after dealing with any active network taps. 1236 */ 1237static inline int | 121#endif 122 123 124static device_method_t cxgb_controller_methods[] = { 125 DEVMETHOD(device_probe, cxgb_controller_probe), 126 DEVMETHOD(device_attach, cxgb_controller_attach), 127 DEVMETHOD(device_detach, cxgb_controller_detach), 128 --- 1102 unchanged lines hidden (view full) --- 1231 1232} 1233 1234/* 1235 * Sends an mbuf to an offload queue driver 1236 * after dealing with any active network taps. 1237 */ 1238static inline int |
1238offload_tx(struct toedev *tdev, struct mbuf *m) | 1239offload_tx(struct t3cdev *tdev, struct mbuf *m) |
1239{ 1240 int ret; 1241 1242 critical_enter(); 1243 ret = t3_offload_tx(tdev, m); 1244 critical_exit(); 1245 return (ret); 1246} --- 304 unchanged lines hidden (view full) --- 1551#endif 1552 1553} 1554 1555static int 1556offload_open(struct port_info *pi) 1557{ 1558 struct adapter *adapter = pi->adapter; | 1240{ 1241 int ret; 1242 1243 critical_enter(); 1244 ret = t3_offload_tx(tdev, m); 1245 critical_exit(); 1246 return (ret); 1247} --- 304 unchanged lines hidden (view full) --- 1552#endif 1553 1554} 1555 1556static int 1557offload_open(struct port_info *pi) 1558{ 1559 struct adapter *adapter = pi->adapter; |
1559 struct toedev *tdev = TOEDEV(pi->ifp); | 1560 struct t3cdev *tdev = TOEDEV(pi->ifp); |
1560 int adap_up = adapter->open_device_map & PORT_MASK; 1561 int err = 0; 1562 1563 if (atomic_cmpset_int(&adapter->open_device_map, 1564 (adapter->open_device_map & ~OFFLOAD_DEVMAP_BIT), 1565 (adapter->open_device_map | OFFLOAD_DEVMAP_BIT)) == 0) 1566 return (0); 1567 --- 26 unchanged lines hidden (view full) --- 1594 t3_tp_set_offload_mode(adapter, 0); 1595 clrbit(&adapter->open_device_map, OFFLOAD_DEVMAP_BIT); 1596 cxgb_set_dummy_ops(tdev); 1597 } 1598 return (err); 1599} 1600#ifdef notyet 1601static int | 1561 int adap_up = adapter->open_device_map & PORT_MASK; 1562 int err = 0; 1563 1564 if (atomic_cmpset_int(&adapter->open_device_map, 1565 (adapter->open_device_map & ~OFFLOAD_DEVMAP_BIT), 1566 (adapter->open_device_map | OFFLOAD_DEVMAP_BIT)) == 0) 1567 return (0); 1568 --- 26 unchanged lines hidden (view full) --- 1595 t3_tp_set_offload_mode(adapter, 0); 1596 clrbit(&adapter->open_device_map, OFFLOAD_DEVMAP_BIT); 1597 cxgb_set_dummy_ops(tdev); 1598 } 1599 return (err); 1600} 1601#ifdef notyet 1602static int |
1602offload_close(struct toedev *tdev) | 1603offload_close(struct t3cev *tdev) |
1603{ 1604 struct adapter *adapter = tdev2adap(tdev); 1605 1606 if (!isset(&adapter->open_device_map, OFFLOAD_DEVMAP_BIT)) 1607 return (0); 1608 1609 /* Call back all registered clients */ 1610 cxgb_remove_clients(tdev); --- 1018 unchanged lines hidden --- | 1604{ 1605 struct adapter *adapter = tdev2adap(tdev); 1606 1607 if (!isset(&adapter->open_device_map, OFFLOAD_DEVMAP_BIT)) 1608 return (0); 1609 1610 /* Call back all registered clients */ 1611 cxgb_remove_clients(tdev); --- 1018 unchanged lines hidden --- |