Christoph Lameter | 8199d3a | 2005-03-30 13:34:31 -0800 | [diff] [blame] | 1 | /***************************************************************************** |
| 2 | * * |
| 3 | * File: common.h * |
Scott Bardone | 559fb51 | 2005-06-23 01:40:19 -0400 | [diff] [blame] | 4 | * $Revision: 1.21 $ * |
| 5 | * $Date: 2005/06/22 00:43:25 $ * |
Christoph Lameter | 8199d3a | 2005-03-30 13:34:31 -0800 | [diff] [blame] | 6 | * Description: * |
| 7 | * part of the Chelsio 10Gb Ethernet Driver. * |
| 8 | * * |
| 9 | * This program is free software; you can redistribute it and/or modify * |
| 10 | * it under the terms of the GNU General Public License, version 2, as * |
| 11 | * published by the Free Software Foundation. * |
| 12 | * * |
| 13 | * You should have received a copy of the GNU General Public License along * |
| 14 | * with this program; if not, write to the Free Software Foundation, Inc., * |
| 15 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
| 16 | * * |
| 17 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * |
| 18 | * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * |
| 19 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * |
| 20 | * * |
| 21 | * http://www.chelsio.com * |
| 22 | * * |
| 23 | * Copyright (c) 2003 - 2005 Chelsio Communications, Inc. * |
| 24 | * All rights reserved. * |
| 25 | * * |
| 26 | * Maintainers: maintainers@chelsio.com * |
| 27 | * * |
| 28 | * Authors: Dimitrios Michailidis <dm@chelsio.com> * |
| 29 | * Tina Yang <tainay@chelsio.com> * |
| 30 | * Felix Marti <felix@chelsio.com> * |
| 31 | * Scott Bardone <sbardone@chelsio.com> * |
| 32 | * Kurt Ottaway <kottaway@chelsio.com> * |
| 33 | * Frank DiMambro <frank@chelsio.com> * |
| 34 | * * |
| 35 | * History: * |
| 36 | * * |
| 37 | ****************************************************************************/ |
| 38 | |
Joe Perches | c1f5121 | 2010-02-22 16:56:57 +0000 | [diff] [blame] | 39 | #define pr_fmt(fmt) "cxgb: " fmt |
| 40 | |
Scott Bardone | 559fb51 | 2005-06-23 01:40:19 -0400 | [diff] [blame] | 41 | #ifndef _CXGB_COMMON_H_ |
| 42 | #define _CXGB_COMMON_H_ |
Christoph Lameter | 8199d3a | 2005-03-30 13:34:31 -0800 | [diff] [blame] | 43 | |
Scott Bardone | 559fb51 | 2005-06-23 01:40:19 -0400 | [diff] [blame] | 44 | #include <linux/module.h> |
| 45 | #include <linux/netdevice.h> |
| 46 | #include <linux/types.h> |
| 47 | #include <linux/delay.h> |
| 48 | #include <linux/pci.h> |
| 49 | #include <linux/ethtool.h> |
Stephen Hemminger | f1d3d38 | 2006-12-01 16:36:16 -0800 | [diff] [blame] | 50 | #include <linux/if_vlan.h> |
Ben Hutchings | 23c3320 | 2009-04-29 08:06:34 +0000 | [diff] [blame] | 51 | #include <linux/mdio.h> |
Scott Bardone | 559fb51 | 2005-06-23 01:40:19 -0400 | [diff] [blame] | 52 | #include <linux/crc32.h> |
| 53 | #include <linux/init.h> |
Tejun Heo | 5a0e3ad | 2010-03-24 17:04:11 +0900 | [diff] [blame] | 54 | #include <linux/slab.h> |
Scott Bardone | 559fb51 | 2005-06-23 01:40:19 -0400 | [diff] [blame] | 55 | #include <asm/io.h> |
| 56 | #include <linux/pci_ids.h> |
Christoph Lameter | 8199d3a | 2005-03-30 13:34:31 -0800 | [diff] [blame] | 57 | |
Scott Bardone | 559fb51 | 2005-06-23 01:40:19 -0400 | [diff] [blame] | 58 | #define DRV_DESCRIPTION "Chelsio 10Gb Ethernet Driver" |
| 59 | #define DRV_NAME "cxgb" |
Stephen Hemminger | f1d3d38 | 2006-12-01 16:36:16 -0800 | [diff] [blame] | 60 | #define DRV_VERSION "2.2" |
Stephen Hemminger | f1d3d38 | 2006-12-01 16:36:16 -0800 | [diff] [blame] | 61 | |
Scott Bardone | 559fb51 | 2005-06-23 01:40:19 -0400 | [diff] [blame] | 62 | #define CH_DEVICE(devid, ssid, idx) \ |
| 63 | { PCI_VENDOR_ID_CHELSIO, devid, PCI_ANY_ID, ssid, 0, 0, idx } |
| 64 | |
| 65 | #define SUPPORTED_PAUSE (1 << 13) |
| 66 | #define SUPPORTED_LOOPBACK (1 << 15) |
| 67 | |
| 68 | #define ADVERTISED_PAUSE (1 << 13) |
| 69 | #define ADVERTISED_ASYM_PAUSE (1 << 14) |
| 70 | |
| 71 | typedef struct adapter adapter_t; |
| 72 | |
Scott Bardone | 559fb51 | 2005-06-23 01:40:19 -0400 | [diff] [blame] | 73 | struct t1_rx_mode { |
Jiri Pirko | 305b016 | 2010-02-17 11:56:45 +0000 | [diff] [blame] | 74 | struct net_device *dev; |
Scott Bardone | 559fb51 | 2005-06-23 01:40:19 -0400 | [diff] [blame] | 75 | }; |
| 76 | |
| 77 | #define t1_rx_mode_promisc(rm) (rm->dev->flags & IFF_PROMISC) |
| 78 | #define t1_rx_mode_allmulti(rm) (rm->dev->flags & IFF_ALLMULTI) |
Jiri Pirko | 4cd24ea | 2010-02-08 04:30:35 +0000 | [diff] [blame] | 79 | #define t1_rx_mode_mc_cnt(rm) (netdev_mc_count(rm->dev)) |
Jiri Pirko | 305b016 | 2010-02-17 11:56:45 +0000 | [diff] [blame] | 80 | #define t1_get_netdev(rm) (rm->dev) |
Scott Bardone | 559fb51 | 2005-06-23 01:40:19 -0400 | [diff] [blame] | 81 | |
| 82 | #define MAX_NPORTS 4 |
Stephen Hemminger | f1d3d38 | 2006-12-01 16:36:16 -0800 | [diff] [blame] | 83 | #define PORT_MASK ((1 << MAX_NPORTS) - 1) |
| 84 | #define NMTUS 8 |
| 85 | #define TCB_SIZE 128 |
Scott Bardone | 559fb51 | 2005-06-23 01:40:19 -0400 | [diff] [blame] | 86 | |
| 87 | #define SPEED_INVALID 0xffff |
| 88 | #define DUPLEX_INVALID 0xff |
Christoph Lameter | 8199d3a | 2005-03-30 13:34:31 -0800 | [diff] [blame] | 89 | |
| 90 | enum { |
Christoph Lameter | 8199d3a | 2005-03-30 13:34:31 -0800 | [diff] [blame] | 91 | CHBT_BOARD_N110, |
Stephen Hemminger | f1d3d38 | 2006-12-01 16:36:16 -0800 | [diff] [blame] | 92 | CHBT_BOARD_N210, |
| 93 | CHBT_BOARD_7500, |
| 94 | CHBT_BOARD_8000, |
| 95 | CHBT_BOARD_CHT101, |
| 96 | CHBT_BOARD_CHT110, |
| 97 | CHBT_BOARD_CHT210, |
| 98 | CHBT_BOARD_CHT204, |
| 99 | CHBT_BOARD_CHT204V, |
| 100 | CHBT_BOARD_CHT204E, |
| 101 | CHBT_BOARD_CHN204, |
| 102 | CHBT_BOARD_COUGAR, |
| 103 | CHBT_BOARD_6800, |
| 104 | CHBT_BOARD_SIMUL, |
Christoph Lameter | 8199d3a | 2005-03-30 13:34:31 -0800 | [diff] [blame] | 105 | }; |
| 106 | |
| 107 | enum { |
Stephen Hemminger | f1d3d38 | 2006-12-01 16:36:16 -0800 | [diff] [blame] | 108 | CHBT_TERM_FPGA, |
Christoph Lameter | 8199d3a | 2005-03-30 13:34:31 -0800 | [diff] [blame] | 109 | CHBT_TERM_T1, |
Stephen Hemminger | f1d3d38 | 2006-12-01 16:36:16 -0800 | [diff] [blame] | 110 | CHBT_TERM_T2, |
| 111 | CHBT_TERM_T3 |
Christoph Lameter | 8199d3a | 2005-03-30 13:34:31 -0800 | [diff] [blame] | 112 | }; |
| 113 | |
| 114 | enum { |
Stephen Hemminger | f1d3d38 | 2006-12-01 16:36:16 -0800 | [diff] [blame] | 115 | CHBT_MAC_CHELSIO_A, |
| 116 | CHBT_MAC_IXF1010, |
Christoph Lameter | 8199d3a | 2005-03-30 13:34:31 -0800 | [diff] [blame] | 117 | CHBT_MAC_PM3393, |
Stephen Hemminger | f1d3d38 | 2006-12-01 16:36:16 -0800 | [diff] [blame] | 118 | CHBT_MAC_VSC7321, |
| 119 | CHBT_MAC_DUMMY |
Christoph Lameter | 8199d3a | 2005-03-30 13:34:31 -0800 | [diff] [blame] | 120 | }; |
| 121 | |
| 122 | enum { |
Stephen Hemminger | f1d3d38 | 2006-12-01 16:36:16 -0800 | [diff] [blame] | 123 | CHBT_PHY_88E1041, |
| 124 | CHBT_PHY_88E1111, |
Christoph Lameter | 8199d3a | 2005-03-30 13:34:31 -0800 | [diff] [blame] | 125 | CHBT_PHY_88X2010, |
Stephen Hemminger | f1d3d38 | 2006-12-01 16:36:16 -0800 | [diff] [blame] | 126 | CHBT_PHY_XPAK, |
| 127 | CHBT_PHY_MY3126, |
| 128 | CHBT_PHY_8244, |
| 129 | CHBT_PHY_DUMMY |
Christoph Lameter | 8199d3a | 2005-03-30 13:34:31 -0800 | [diff] [blame] | 130 | }; |
| 131 | |
| 132 | enum { |
Scott Bardone | 559fb51 | 2005-06-23 01:40:19 -0400 | [diff] [blame] | 133 | PAUSE_RX = 1 << 0, |
| 134 | PAUSE_TX = 1 << 1, |
| 135 | PAUSE_AUTONEG = 1 << 2 |
Christoph Lameter | 8199d3a | 2005-03-30 13:34:31 -0800 | [diff] [blame] | 136 | }; |
| 137 | |
| 138 | /* Revisions of T1 chip */ |
Scott Bardone | 559fb51 | 2005-06-23 01:40:19 -0400 | [diff] [blame] | 139 | enum { |
| 140 | TERM_T1A = 0, |
| 141 | TERM_T1B = 1, |
| 142 | TERM_T2 = 3 |
Christoph Lameter | 8199d3a | 2005-03-30 13:34:31 -0800 | [diff] [blame] | 143 | }; |
| 144 | |
| 145 | struct sge_params { |
| 146 | unsigned int cmdQ_size[2]; |
| 147 | unsigned int freelQ_size[2]; |
| 148 | unsigned int large_buf_capacity; |
| 149 | unsigned int rx_coalesce_usecs; |
| 150 | unsigned int last_rx_coalesce_raw; |
| 151 | unsigned int default_rx_coalesce_usecs; |
| 152 | unsigned int sample_interval_usecs; |
| 153 | unsigned int coalesce_enable; |
| 154 | unsigned int polling; |
| 155 | }; |
| 156 | |
Scott Bardone | 559fb51 | 2005-06-23 01:40:19 -0400 | [diff] [blame] | 157 | struct chelsio_pci_params { |
Christoph Lameter | 8199d3a | 2005-03-30 13:34:31 -0800 | [diff] [blame] | 158 | unsigned short speed; |
| 159 | unsigned char width; |
| 160 | unsigned char is_pcix; |
| 161 | }; |
| 162 | |
Stephen Hemminger | f1d3d38 | 2006-12-01 16:36:16 -0800 | [diff] [blame] | 163 | struct tp_params { |
| 164 | unsigned int pm_size; |
| 165 | unsigned int cm_size; |
| 166 | unsigned int pm_rx_base; |
| 167 | unsigned int pm_tx_base; |
| 168 | unsigned int pm_rx_pg_size; |
| 169 | unsigned int pm_tx_pg_size; |
| 170 | unsigned int pm_rx_num_pgs; |
| 171 | unsigned int pm_tx_num_pgs; |
| 172 | unsigned int rx_coalescing_size; |
| 173 | unsigned int use_5tuple_mode; |
| 174 | }; |
| 175 | |
| 176 | struct mc5_params { |
| 177 | unsigned int mode; /* selects MC5 width */ |
| 178 | unsigned int nservers; /* size of server region */ |
| 179 | unsigned int nroutes; /* size of routing region */ |
| 180 | }; |
| 181 | |
| 182 | /* Default MC5 region sizes */ |
| 183 | #define DEFAULT_SERVER_REGION_LEN 256 |
| 184 | #define DEFAULT_RT_REGION_LEN 1024 |
| 185 | |
Christoph Lameter | 8199d3a | 2005-03-30 13:34:31 -0800 | [diff] [blame] | 186 | struct adapter_params { |
| 187 | struct sge_params sge; |
Stephen Hemminger | f1d3d38 | 2006-12-01 16:36:16 -0800 | [diff] [blame] | 188 | struct mc5_params mc5; |
| 189 | struct tp_params tp; |
Scott Bardone | 559fb51 | 2005-06-23 01:40:19 -0400 | [diff] [blame] | 190 | struct chelsio_pci_params pci; |
Christoph Lameter | 8199d3a | 2005-03-30 13:34:31 -0800 | [diff] [blame] | 191 | |
| 192 | const struct board_info *brd_info; |
| 193 | |
Stephen Hemminger | f1d3d38 | 2006-12-01 16:36:16 -0800 | [diff] [blame] | 194 | unsigned short mtus[NMTUS]; |
Scott Bardone | 559fb51 | 2005-06-23 01:40:19 -0400 | [diff] [blame] | 195 | unsigned int nports; /* # of ethernet ports */ |
Christoph Lameter | 8199d3a | 2005-03-30 13:34:31 -0800 | [diff] [blame] | 196 | unsigned int stats_update_period; |
| 197 | unsigned short chip_revision; |
| 198 | unsigned char chip_version; |
Stephen Hemminger | f1d3d38 | 2006-12-01 16:36:16 -0800 | [diff] [blame] | 199 | unsigned char is_asic; |
Stephen Hemminger | 325dde4 | 2006-12-01 16:36:20 -0800 | [diff] [blame] | 200 | unsigned char has_msi; |
Christoph Lameter | 8199d3a | 2005-03-30 13:34:31 -0800 | [diff] [blame] | 201 | }; |
| 202 | |
| 203 | struct link_config { |
| 204 | unsigned int supported; /* link capabilities */ |
| 205 | unsigned int advertising; /* advertised capabilities */ |
| 206 | unsigned short requested_speed; /* speed user has requested */ |
| 207 | unsigned short speed; /* actual link speed */ |
| 208 | unsigned char requested_duplex; /* duplex user has requested */ |
| 209 | unsigned char duplex; /* actual link duplex */ |
| 210 | unsigned char requested_fc; /* flow control user has requested */ |
| 211 | unsigned char fc; /* actual link flow control */ |
| 212 | unsigned char autoneg; /* autonegotiating? */ |
| 213 | }; |
| 214 | |
Scott Bardone | 559fb51 | 2005-06-23 01:40:19 -0400 | [diff] [blame] | 215 | struct cmac; |
| 216 | struct cphy; |
| 217 | |
| 218 | struct port_info { |
| 219 | struct net_device *dev; |
| 220 | struct cmac *mac; |
| 221 | struct cphy *phy; |
| 222 | struct link_config link_config; |
| 223 | struct net_device_stats netstats; |
| 224 | }; |
| 225 | |
| 226 | struct sge; |
| 227 | struct peespi; |
| 228 | |
| 229 | struct adapter { |
viro@ftp.linux.org.uk | 91fb4c9 | 2005-09-05 03:25:48 +0100 | [diff] [blame] | 230 | u8 __iomem *regs; |
Scott Bardone | 559fb51 | 2005-06-23 01:40:19 -0400 | [diff] [blame] | 231 | struct pci_dev *pdev; |
| 232 | unsigned long registered_device_map; |
| 233 | unsigned long open_device_map; |
| 234 | unsigned long flags; |
| 235 | |
| 236 | const char *name; |
| 237 | int msg_enable; |
| 238 | u32 mmio_len; |
| 239 | |
| 240 | struct work_struct ext_intr_handler_task; |
| 241 | struct adapter_params params; |
| 242 | |
| 243 | struct vlan_group *vlan_grp; |
| 244 | |
| 245 | /* Terminator modules. */ |
| 246 | struct sge *sge; |
| 247 | struct peespi *espi; |
Stephen Hemminger | f1d3d38 | 2006-12-01 16:36:16 -0800 | [diff] [blame] | 248 | struct petp *tp; |
Scott Bardone | 559fb51 | 2005-06-23 01:40:19 -0400 | [diff] [blame] | 249 | |
Stephen Hemminger | bea3348 | 2007-10-03 16:41:36 -0700 | [diff] [blame] | 250 | struct napi_struct napi; |
Scott Bardone | 559fb51 | 2005-06-23 01:40:19 -0400 | [diff] [blame] | 251 | struct port_info port[MAX_NPORTS]; |
David Howells | c402895 | 2006-11-22 14:57:56 +0000 | [diff] [blame] | 252 | struct delayed_work stats_update_task; |
Scott Bardone | 559fb51 | 2005-06-23 01:40:19 -0400 | [diff] [blame] | 253 | struct timer_list stats_update_timer; |
| 254 | |
Scott Bardone | 559fb51 | 2005-06-23 01:40:19 -0400 | [diff] [blame] | 255 | spinlock_t tpi_lock; |
| 256 | spinlock_t work_lock; |
Stephen Hemminger | 352c417 | 2006-12-01 16:36:17 -0800 | [diff] [blame] | 257 | spinlock_t mac_lock; |
| 258 | |
Scott Bardone | 559fb51 | 2005-06-23 01:40:19 -0400 | [diff] [blame] | 259 | /* guards async operations */ |
| 260 | spinlock_t async_lock ____cacheline_aligned; |
| 261 | u32 slow_intr_mask; |
Stephen Hemminger | f1d3d38 | 2006-12-01 16:36:16 -0800 | [diff] [blame] | 262 | int t1powersave; |
Scott Bardone | 559fb51 | 2005-06-23 01:40:19 -0400 | [diff] [blame] | 263 | }; |
| 264 | |
| 265 | enum { /* adapter flags */ |
| 266 | FULL_INIT_DONE = 1 << 0, |
| 267 | TSO_CAPABLE = 1 << 2, |
| 268 | TCP_CSUM_CAPABLE = 1 << 3, |
| 269 | UDP_CSUM_CAPABLE = 1 << 4, |
| 270 | VLAN_ACCEL_CAPABLE = 1 << 5, |
| 271 | RX_CSUM_ENABLED = 1 << 6, |
| 272 | }; |
Christoph Lameter | 8199d3a | 2005-03-30 13:34:31 -0800 | [diff] [blame] | 273 | |
| 274 | struct mdio_ops; |
| 275 | struct gmac; |
| 276 | struct gphy; |
| 277 | |
| 278 | struct board_info { |
| 279 | unsigned char board; |
| 280 | unsigned char port_number; |
| 281 | unsigned long caps; |
| 282 | unsigned char chip_term; |
| 283 | unsigned char chip_mac; |
| 284 | unsigned char chip_phy; |
| 285 | unsigned int clock_core; |
| 286 | unsigned int clock_mc3; |
| 287 | unsigned int clock_mc4; |
| 288 | unsigned int espi_nports; |
Christoph Lameter | 8199d3a | 2005-03-30 13:34:31 -0800 | [diff] [blame] | 289 | unsigned int clock_elmer0; |
| 290 | unsigned char mdio_mdien; |
| 291 | unsigned char mdio_mdiinv; |
| 292 | unsigned char mdio_mdc; |
| 293 | unsigned char mdio_phybaseaddr; |
Stephen Hemminger | 459e536 | 2007-02-20 15:58:02 -0800 | [diff] [blame] | 294 | const struct gmac *gmac; |
| 295 | const struct gphy *gphy; |
| 296 | const struct mdio_ops *mdio_ops; |
Christoph Lameter | 8199d3a | 2005-03-30 13:34:31 -0800 | [diff] [blame] | 297 | const char *desc; |
| 298 | }; |
| 299 | |
Stephen Hemminger | f1d3d38 | 2006-12-01 16:36:16 -0800 | [diff] [blame] | 300 | static inline int t1_is_asic(const adapter_t *adapter) |
| 301 | { |
| 302 | return adapter->params.is_asic; |
| 303 | } |
| 304 | |
Alexey Dobriyan | a3aa188 | 2010-01-07 11:58:11 +0000 | [diff] [blame] | 305 | extern const struct pci_device_id t1_pci_tbl[]; |
Christoph Lameter | 8199d3a | 2005-03-30 13:34:31 -0800 | [diff] [blame] | 306 | |
Christoph Lameter | 8199d3a | 2005-03-30 13:34:31 -0800 | [diff] [blame] | 307 | static inline int adapter_matches_type(const adapter_t *adapter, |
| 308 | int version, int revision) |
| 309 | { |
| 310 | return adapter->params.chip_version == version && |
| 311 | adapter->params.chip_revision == revision; |
| 312 | } |
| 313 | |
| 314 | #define t1_is_T1B(adap) adapter_matches_type(adap, CHBT_TERM_T1, TERM_T1B) |
| 315 | #define is_T2(adap) adapter_matches_type(adap, CHBT_TERM_T2, TERM_T2) |
| 316 | |
| 317 | /* Returns true if an adapter supports VLAN acceleration and TSO */ |
| 318 | static inline int vlan_tso_capable(const adapter_t *adapter) |
| 319 | { |
| 320 | return !t1_is_T1B(adapter); |
| 321 | } |
| 322 | |
| 323 | #define for_each_port(adapter, iter) \ |
| 324 | for (iter = 0; iter < (adapter)->params.nports; ++iter) |
| 325 | |
| 326 | #define board_info(adapter) ((adapter)->params.brd_info) |
| 327 | #define is_10G(adapter) (board_info(adapter)->caps & SUPPORTED_10000baseT_Full) |
| 328 | |
| 329 | static inline unsigned int core_ticks_per_usec(const adapter_t *adap) |
| 330 | { |
| 331 | return board_info(adap)->clock_core / 1000000; |
| 332 | } |
| 333 | |
Stephen Hemminger | f1d3d38 | 2006-12-01 16:36:16 -0800 | [diff] [blame] | 334 | extern int __t1_tpi_read(adapter_t *adapter, u32 addr, u32 *valp); |
| 335 | extern int __t1_tpi_write(adapter_t *adapter, u32 addr, u32 value); |
Scott Bardone | 559fb51 | 2005-06-23 01:40:19 -0400 | [diff] [blame] | 336 | extern int t1_tpi_write(adapter_t *adapter, u32 addr, u32 value); |
| 337 | extern int t1_tpi_read(adapter_t *adapter, u32 addr, u32 *value); |
Christoph Lameter | 8199d3a | 2005-03-30 13:34:31 -0800 | [diff] [blame] | 338 | |
Scott Bardone | 559fb51 | 2005-06-23 01:40:19 -0400 | [diff] [blame] | 339 | extern void t1_interrupts_enable(adapter_t *adapter); |
| 340 | extern void t1_interrupts_disable(adapter_t *adapter); |
| 341 | extern void t1_interrupts_clear(adapter_t *adapter); |
Stephen Hemminger | f1d3d38 | 2006-12-01 16:36:16 -0800 | [diff] [blame] | 342 | extern int t1_elmer0_ext_intr_handler(adapter_t *adapter); |
Stephen Hemminger | 33a85aa | 2007-10-08 16:19:10 -0700 | [diff] [blame] | 343 | extern void t1_elmer0_ext_intr(adapter_t *adapter); |
Scott Bardone | 559fb51 | 2005-06-23 01:40:19 -0400 | [diff] [blame] | 344 | extern int t1_slow_intr_handler(adapter_t *adapter); |
Christoph Lameter | 8199d3a | 2005-03-30 13:34:31 -0800 | [diff] [blame] | 345 | |
Scott Bardone | 559fb51 | 2005-06-23 01:40:19 -0400 | [diff] [blame] | 346 | extern int t1_link_start(struct cphy *phy, struct cmac *mac, struct link_config *lc); |
| 347 | extern const struct board_info *t1_get_board_info(unsigned int board_id); |
| 348 | extern const struct board_info *t1_get_board_info_from_ids(unsigned int devid, |
Christoph Lameter | 8199d3a | 2005-03-30 13:34:31 -0800 | [diff] [blame] | 349 | unsigned short ssid); |
Al Viro | ac390c6 | 2007-12-22 18:56:33 +0000 | [diff] [blame] | 350 | extern int t1_seeprom_read(adapter_t *adapter, u32 addr, __le32 *data); |
Scott Bardone | 559fb51 | 2005-06-23 01:40:19 -0400 | [diff] [blame] | 351 | extern int t1_get_board_rev(adapter_t *adapter, const struct board_info *bi, |
Christoph Lameter | 8199d3a | 2005-03-30 13:34:31 -0800 | [diff] [blame] | 352 | struct adapter_params *p); |
Scott Bardone | 559fb51 | 2005-06-23 01:40:19 -0400 | [diff] [blame] | 353 | extern int t1_init_hw_modules(adapter_t *adapter); |
| 354 | extern int t1_init_sw_modules(adapter_t *adapter, const struct board_info *bi); |
| 355 | extern void t1_free_sw_modules(adapter_t *adapter); |
| 356 | extern void t1_fatal_err(adapter_t *adapter); |
Stephen Hemminger | f1d3d38 | 2006-12-01 16:36:16 -0800 | [diff] [blame] | 357 | extern void t1_link_changed(adapter_t *adapter, int port_id); |
| 358 | extern void t1_link_negotiated(adapter_t *adapter, int port_id, int link_stat, |
| 359 | int speed, int duplex, int pause); |
Scott Bardone | 559fb51 | 2005-06-23 01:40:19 -0400 | [diff] [blame] | 360 | #endif /* _CXGB_COMMON_H_ */ |