hw.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708
  1. /* Intel PRO/1000 Linux driver
  2. * Copyright(c) 1999 - 2015 Intel Corporation.
  3. *
  4. * This program is free software; you can redistribute it and/or modify it
  5. * under the terms and conditions of the GNU General Public License,
  6. * version 2, as published by the Free Software Foundation.
  7. *
  8. * This program is distributed in the hope it will be useful, but WITHOUT
  9. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  10. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  11. * more details.
  12. *
  13. * The full GNU General Public License is included in this distribution in
  14. * the file called "COPYING".
  15. *
  16. * Contact Information:
  17. * Linux NICS <linux.nics@intel.com>
  18. * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
  19. * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
  20. */
  21. #ifndef _E1000_HW_H_
  22. #define _E1000_HW_H_
  23. #include "regs.h"
  24. #include "defines.h"
  25. struct e1000_hw;
  26. #define E1000_DEV_ID_82571EB_COPPER 0x105E
  27. #define E1000_DEV_ID_82571EB_FIBER 0x105F
  28. #define E1000_DEV_ID_82571EB_SERDES 0x1060
  29. #define E1000_DEV_ID_82571EB_QUAD_COPPER 0x10A4
  30. #define E1000_DEV_ID_82571PT_QUAD_COPPER 0x10D5
  31. #define E1000_DEV_ID_82571EB_QUAD_FIBER 0x10A5
  32. #define E1000_DEV_ID_82571EB_QUAD_COPPER_LP 0x10BC
  33. #define E1000_DEV_ID_82571EB_SERDES_DUAL 0x10D9
  34. #define E1000_DEV_ID_82571EB_SERDES_QUAD 0x10DA
  35. #define E1000_DEV_ID_82572EI_COPPER 0x107D
  36. #define E1000_DEV_ID_82572EI_FIBER 0x107E
  37. #define E1000_DEV_ID_82572EI_SERDES 0x107F
  38. #define E1000_DEV_ID_82572EI 0x10B9
  39. #define E1000_DEV_ID_82573E 0x108B
  40. #define E1000_DEV_ID_82573E_IAMT 0x108C
  41. #define E1000_DEV_ID_82573L 0x109A
  42. #define E1000_DEV_ID_82574L 0x10D3
  43. #define E1000_DEV_ID_82574LA 0x10F6
  44. #define E1000_DEV_ID_82583V 0x150C
  45. #define E1000_DEV_ID_80003ES2LAN_COPPER_DPT 0x1096
  46. #define E1000_DEV_ID_80003ES2LAN_SERDES_DPT 0x1098
  47. #define E1000_DEV_ID_80003ES2LAN_COPPER_SPT 0x10BA
  48. #define E1000_DEV_ID_80003ES2LAN_SERDES_SPT 0x10BB
  49. #define E1000_DEV_ID_ICH8_82567V_3 0x1501
  50. #define E1000_DEV_ID_ICH8_IGP_M_AMT 0x1049
  51. #define E1000_DEV_ID_ICH8_IGP_AMT 0x104A
  52. #define E1000_DEV_ID_ICH8_IGP_C 0x104B
  53. #define E1000_DEV_ID_ICH8_IFE 0x104C
  54. #define E1000_DEV_ID_ICH8_IFE_GT 0x10C4
  55. #define E1000_DEV_ID_ICH8_IFE_G 0x10C5
  56. #define E1000_DEV_ID_ICH8_IGP_M 0x104D
  57. #define E1000_DEV_ID_ICH9_IGP_AMT 0x10BD
  58. #define E1000_DEV_ID_ICH9_BM 0x10E5
  59. #define E1000_DEV_ID_ICH9_IGP_M_AMT 0x10F5
  60. #define E1000_DEV_ID_ICH9_IGP_M 0x10BF
  61. #define E1000_DEV_ID_ICH9_IGP_M_V 0x10CB
  62. #define E1000_DEV_ID_ICH9_IGP_C 0x294C
  63. #define E1000_DEV_ID_ICH9_IFE 0x10C0
  64. #define E1000_DEV_ID_ICH9_IFE_GT 0x10C3
  65. #define E1000_DEV_ID_ICH9_IFE_G 0x10C2
  66. #define E1000_DEV_ID_ICH10_R_BM_LM 0x10CC
  67. #define E1000_DEV_ID_ICH10_R_BM_LF 0x10CD
  68. #define E1000_DEV_ID_ICH10_R_BM_V 0x10CE
  69. #define E1000_DEV_ID_ICH10_D_BM_LM 0x10DE
  70. #define E1000_DEV_ID_ICH10_D_BM_LF 0x10DF
  71. #define E1000_DEV_ID_ICH10_D_BM_V 0x1525
  72. #define E1000_DEV_ID_PCH_M_HV_LM 0x10EA
  73. #define E1000_DEV_ID_PCH_M_HV_LC 0x10EB
  74. #define E1000_DEV_ID_PCH_D_HV_DM 0x10EF
  75. #define E1000_DEV_ID_PCH_D_HV_DC 0x10F0
  76. #define E1000_DEV_ID_PCH2_LV_LM 0x1502
  77. #define E1000_DEV_ID_PCH2_LV_V 0x1503
  78. #define E1000_DEV_ID_PCH_LPT_I217_LM 0x153A
  79. #define E1000_DEV_ID_PCH_LPT_I217_V 0x153B
  80. #define E1000_DEV_ID_PCH_LPTLP_I218_LM 0x155A
  81. #define E1000_DEV_ID_PCH_LPTLP_I218_V 0x1559
  82. #define E1000_DEV_ID_PCH_I218_LM2 0x15A0
  83. #define E1000_DEV_ID_PCH_I218_V2 0x15A1
  84. #define E1000_DEV_ID_PCH_I218_LM3 0x15A2 /* Wildcat Point PCH */
  85. #define E1000_DEV_ID_PCH_I218_V3 0x15A3 /* Wildcat Point PCH */
  86. #define E1000_DEV_ID_PCH_SPT_I219_LM 0x156F /* SPT PCH */
  87. #define E1000_DEV_ID_PCH_SPT_I219_V 0x1570 /* SPT PCH */
  88. #define E1000_DEV_ID_PCH_SPT_I219_LM2 0x15B7 /* SPT-H PCH */
  89. #define E1000_DEV_ID_PCH_SPT_I219_V2 0x15B8 /* SPT-H PCH */
  90. #define E1000_DEV_ID_PCH_LBG_I219_LM3 0x15B9 /* LBG PCH */
  91. #define E1000_DEV_ID_PCH_SPT_I219_LM4 0x15D7
  92. #define E1000_DEV_ID_PCH_SPT_I219_V4 0x15D8
  93. #define E1000_DEV_ID_PCH_SPT_I219_LM5 0x15E3
  94. #define E1000_DEV_ID_PCH_SPT_I219_V5 0x15D6
  95. #define E1000_DEV_ID_PCH_CNP_I219_LM6 0x15BD
  96. #define E1000_DEV_ID_PCH_CNP_I219_V6 0x15BE
  97. #define E1000_DEV_ID_PCH_CNP_I219_LM7 0x15BB
  98. #define E1000_DEV_ID_PCH_CNP_I219_V7 0x15BC
  99. #define E1000_REVISION_4 4
  100. #define E1000_FUNC_1 1
  101. #define E1000_ALT_MAC_ADDRESS_OFFSET_LAN0 0
  102. #define E1000_ALT_MAC_ADDRESS_OFFSET_LAN1 3
  103. enum e1000_mac_type {
  104. e1000_82571,
  105. e1000_82572,
  106. e1000_82573,
  107. e1000_82574,
  108. e1000_82583,
  109. e1000_80003es2lan,
  110. e1000_ich8lan,
  111. e1000_ich9lan,
  112. e1000_ich10lan,
  113. e1000_pchlan,
  114. e1000_pch2lan,
  115. e1000_pch_lpt,
  116. e1000_pch_spt,
  117. e1000_pch_cnp,
  118. };
  119. enum e1000_media_type {
  120. e1000_media_type_unknown = 0,
  121. e1000_media_type_copper = 1,
  122. e1000_media_type_fiber = 2,
  123. e1000_media_type_internal_serdes = 3,
  124. e1000_num_media_types
  125. };
  126. enum e1000_nvm_type {
  127. e1000_nvm_unknown = 0,
  128. e1000_nvm_none,
  129. e1000_nvm_eeprom_spi,
  130. e1000_nvm_flash_hw,
  131. e1000_nvm_flash_sw
  132. };
  133. enum e1000_nvm_override {
  134. e1000_nvm_override_none = 0,
  135. e1000_nvm_override_spi_small,
  136. e1000_nvm_override_spi_large
  137. };
  138. enum e1000_phy_type {
  139. e1000_phy_unknown = 0,
  140. e1000_phy_none,
  141. e1000_phy_m88,
  142. e1000_phy_igp,
  143. e1000_phy_igp_2,
  144. e1000_phy_gg82563,
  145. e1000_phy_igp_3,
  146. e1000_phy_ife,
  147. e1000_phy_bm,
  148. e1000_phy_82578,
  149. e1000_phy_82577,
  150. e1000_phy_82579,
  151. e1000_phy_i217,
  152. };
  153. enum e1000_bus_width {
  154. e1000_bus_width_unknown = 0,
  155. e1000_bus_width_pcie_x1,
  156. e1000_bus_width_pcie_x2,
  157. e1000_bus_width_pcie_x4 = 4,
  158. e1000_bus_width_pcie_x8 = 8,
  159. e1000_bus_width_32,
  160. e1000_bus_width_64,
  161. e1000_bus_width_reserved
  162. };
  163. enum e1000_1000t_rx_status {
  164. e1000_1000t_rx_status_not_ok = 0,
  165. e1000_1000t_rx_status_ok,
  166. e1000_1000t_rx_status_undefined = 0xFF
  167. };
  168. enum e1000_rev_polarity {
  169. e1000_rev_polarity_normal = 0,
  170. e1000_rev_polarity_reversed,
  171. e1000_rev_polarity_undefined = 0xFF
  172. };
  173. enum e1000_fc_mode {
  174. e1000_fc_none = 0,
  175. e1000_fc_rx_pause,
  176. e1000_fc_tx_pause,
  177. e1000_fc_full,
  178. e1000_fc_default = 0xFF
  179. };
  180. enum e1000_ms_type {
  181. e1000_ms_hw_default = 0,
  182. e1000_ms_force_master,
  183. e1000_ms_force_slave,
  184. e1000_ms_auto
  185. };
  186. enum e1000_smart_speed {
  187. e1000_smart_speed_default = 0,
  188. e1000_smart_speed_on,
  189. e1000_smart_speed_off
  190. };
  191. enum e1000_serdes_link_state {
  192. e1000_serdes_link_down = 0,
  193. e1000_serdes_link_autoneg_progress,
  194. e1000_serdes_link_autoneg_complete,
  195. e1000_serdes_link_forced_up
  196. };
  197. /* Receive Descriptor - Extended */
  198. union e1000_rx_desc_extended {
  199. struct {
  200. __le64 buffer_addr;
  201. __le64 reserved;
  202. } read;
  203. struct {
  204. struct {
  205. __le32 mrq; /* Multiple Rx Queues */
  206. union {
  207. __le32 rss; /* RSS Hash */
  208. struct {
  209. __le16 ip_id; /* IP id */
  210. __le16 csum; /* Packet Checksum */
  211. } csum_ip;
  212. } hi_dword;
  213. } lower;
  214. struct {
  215. __le32 status_error; /* ext status/error */
  216. __le16 length;
  217. __le16 vlan; /* VLAN tag */
  218. } upper;
  219. } wb; /* writeback */
  220. };
  221. #define MAX_PS_BUFFERS 4
  222. /* Number of packet split data buffers (not including the header buffer) */
  223. #define PS_PAGE_BUFFERS (MAX_PS_BUFFERS - 1)
  224. /* Receive Descriptor - Packet Split */
  225. union e1000_rx_desc_packet_split {
  226. struct {
  227. /* one buffer for protocol header(s), three data buffers */
  228. __le64 buffer_addr[MAX_PS_BUFFERS];
  229. } read;
  230. struct {
  231. struct {
  232. __le32 mrq; /* Multiple Rx Queues */
  233. union {
  234. __le32 rss; /* RSS Hash */
  235. struct {
  236. __le16 ip_id; /* IP id */
  237. __le16 csum; /* Packet Checksum */
  238. } csum_ip;
  239. } hi_dword;
  240. } lower;
  241. struct {
  242. __le32 status_error; /* ext status/error */
  243. __le16 length0; /* length of buffer 0 */
  244. __le16 vlan; /* VLAN tag */
  245. } middle;
  246. struct {
  247. __le16 header_status;
  248. /* length of buffers 1-3 */
  249. __le16 length[PS_PAGE_BUFFERS];
  250. } upper;
  251. __le64 reserved;
  252. } wb; /* writeback */
  253. };
  254. /* Transmit Descriptor */
  255. struct e1000_tx_desc {
  256. __le64 buffer_addr; /* Address of the descriptor's data buffer */
  257. union {
  258. __le32 data;
  259. struct {
  260. __le16 length; /* Data buffer length */
  261. u8 cso; /* Checksum offset */
  262. u8 cmd; /* Descriptor control */
  263. } flags;
  264. } lower;
  265. union {
  266. __le32 data;
  267. struct {
  268. u8 status; /* Descriptor status */
  269. u8 css; /* Checksum start */
  270. __le16 special;
  271. } fields;
  272. } upper;
  273. };
  274. /* Offload Context Descriptor */
  275. struct e1000_context_desc {
  276. union {
  277. __le32 ip_config;
  278. struct {
  279. u8 ipcss; /* IP checksum start */
  280. u8 ipcso; /* IP checksum offset */
  281. __le16 ipcse; /* IP checksum end */
  282. } ip_fields;
  283. } lower_setup;
  284. union {
  285. __le32 tcp_config;
  286. struct {
  287. u8 tucss; /* TCP checksum start */
  288. u8 tucso; /* TCP checksum offset */
  289. __le16 tucse; /* TCP checksum end */
  290. } tcp_fields;
  291. } upper_setup;
  292. __le32 cmd_and_length;
  293. union {
  294. __le32 data;
  295. struct {
  296. u8 status; /* Descriptor status */
  297. u8 hdr_len; /* Header length */
  298. __le16 mss; /* Maximum segment size */
  299. } fields;
  300. } tcp_seg_setup;
  301. };
  302. /* Offload data descriptor */
  303. struct e1000_data_desc {
  304. __le64 buffer_addr; /* Address of the descriptor's buffer address */
  305. union {
  306. __le32 data;
  307. struct {
  308. __le16 length; /* Data buffer length */
  309. u8 typ_len_ext;
  310. u8 cmd;
  311. } flags;
  312. } lower;
  313. union {
  314. __le32 data;
  315. struct {
  316. u8 status; /* Descriptor status */
  317. u8 popts; /* Packet Options */
  318. __le16 special;
  319. } fields;
  320. } upper;
  321. };
  322. /* Statistics counters collected by the MAC */
  323. struct e1000_hw_stats {
  324. u64 crcerrs;
  325. u64 algnerrc;
  326. u64 symerrs;
  327. u64 rxerrc;
  328. u64 mpc;
  329. u64 scc;
  330. u64 ecol;
  331. u64 mcc;
  332. u64 latecol;
  333. u64 colc;
  334. u64 dc;
  335. u64 tncrs;
  336. u64 sec;
  337. u64 cexterr;
  338. u64 rlec;
  339. u64 xonrxc;
  340. u64 xontxc;
  341. u64 xoffrxc;
  342. u64 xofftxc;
  343. u64 fcruc;
  344. u64 prc64;
  345. u64 prc127;
  346. u64 prc255;
  347. u64 prc511;
  348. u64 prc1023;
  349. u64 prc1522;
  350. u64 gprc;
  351. u64 bprc;
  352. u64 mprc;
  353. u64 gptc;
  354. u64 gorc;
  355. u64 gotc;
  356. u64 rnbc;
  357. u64 ruc;
  358. u64 rfc;
  359. u64 roc;
  360. u64 rjc;
  361. u64 mgprc;
  362. u64 mgpdc;
  363. u64 mgptc;
  364. u64 tor;
  365. u64 tot;
  366. u64 tpr;
  367. u64 tpt;
  368. u64 ptc64;
  369. u64 ptc127;
  370. u64 ptc255;
  371. u64 ptc511;
  372. u64 ptc1023;
  373. u64 ptc1522;
  374. u64 mptc;
  375. u64 bptc;
  376. u64 tsctc;
  377. u64 tsctfc;
  378. u64 iac;
  379. u64 icrxptc;
  380. u64 icrxatc;
  381. u64 ictxptc;
  382. u64 ictxatc;
  383. u64 ictxqec;
  384. u64 ictxqmtc;
  385. u64 icrxdmtc;
  386. u64 icrxoc;
  387. };
  388. struct e1000_phy_stats {
  389. u32 idle_errors;
  390. u32 receive_errors;
  391. };
  392. struct e1000_host_mng_dhcp_cookie {
  393. u32 signature;
  394. u8 status;
  395. u8 reserved0;
  396. u16 vlan_id;
  397. u32 reserved1;
  398. u16 reserved2;
  399. u8 reserved3;
  400. u8 checksum;
  401. };
  402. /* Host Interface "Rev 1" */
  403. struct e1000_host_command_header {
  404. u8 command_id;
  405. u8 command_length;
  406. u8 command_options;
  407. u8 checksum;
  408. };
  409. #define E1000_HI_MAX_DATA_LENGTH 252
  410. struct e1000_host_command_info {
  411. struct e1000_host_command_header command_header;
  412. u8 command_data[E1000_HI_MAX_DATA_LENGTH];
  413. };
  414. /* Host Interface "Rev 2" */
  415. struct e1000_host_mng_command_header {
  416. u8 command_id;
  417. u8 checksum;
  418. u16 reserved1;
  419. u16 reserved2;
  420. u16 command_length;
  421. };
  422. #define E1000_HI_MAX_MNG_DATA_LENGTH 0x6F8
  423. struct e1000_host_mng_command_info {
  424. struct e1000_host_mng_command_header command_header;
  425. u8 command_data[E1000_HI_MAX_MNG_DATA_LENGTH];
  426. };
  427. #include "mac.h"
  428. #include "phy.h"
  429. #include "nvm.h"
  430. #include "manage.h"
  431. /* Function pointers for the MAC. */
  432. struct e1000_mac_operations {
  433. s32 (*id_led_init)(struct e1000_hw *);
  434. s32 (*blink_led)(struct e1000_hw *);
  435. bool (*check_mng_mode)(struct e1000_hw *);
  436. s32 (*check_for_link)(struct e1000_hw *);
  437. s32 (*cleanup_led)(struct e1000_hw *);
  438. void (*clear_hw_cntrs)(struct e1000_hw *);
  439. void (*clear_vfta)(struct e1000_hw *);
  440. s32 (*get_bus_info)(struct e1000_hw *);
  441. void (*set_lan_id)(struct e1000_hw *);
  442. s32 (*get_link_up_info)(struct e1000_hw *, u16 *, u16 *);
  443. s32 (*led_on)(struct e1000_hw *);
  444. s32 (*led_off)(struct e1000_hw *);
  445. void (*update_mc_addr_list)(struct e1000_hw *, u8 *, u32);
  446. s32 (*reset_hw)(struct e1000_hw *);
  447. s32 (*init_hw)(struct e1000_hw *);
  448. s32 (*setup_link)(struct e1000_hw *);
  449. s32 (*setup_physical_interface)(struct e1000_hw *);
  450. s32 (*setup_led)(struct e1000_hw *);
  451. void (*write_vfta)(struct e1000_hw *, u32, u32);
  452. void (*config_collision_dist)(struct e1000_hw *);
  453. int (*rar_set)(struct e1000_hw *, u8 *, u32);
  454. s32 (*read_mac_addr)(struct e1000_hw *);
  455. u32 (*rar_get_count)(struct e1000_hw *);
  456. };
  457. /* When to use various PHY register access functions:
  458. *
  459. * Func Caller
  460. * Function Does Does When to use
  461. * ~~~~~~~~~~~~ ~~~~~ ~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  462. * X_reg L,P,A n/a for simple PHY reg accesses
  463. * X_reg_locked P,A L for multiple accesses of different regs
  464. * on different pages
  465. * X_reg_page A L,P for multiple accesses of different regs
  466. * on the same page
  467. *
  468. * Where X=[read|write], L=locking, P=sets page, A=register access
  469. *
  470. */
  471. struct e1000_phy_operations {
  472. s32 (*acquire)(struct e1000_hw *);
  473. s32 (*cfg_on_link_up)(struct e1000_hw *);
  474. s32 (*check_polarity)(struct e1000_hw *);
  475. s32 (*check_reset_block)(struct e1000_hw *);
  476. s32 (*commit)(struct e1000_hw *);
  477. s32 (*force_speed_duplex)(struct e1000_hw *);
  478. s32 (*get_cfg_done)(struct e1000_hw *hw);
  479. s32 (*get_cable_length)(struct e1000_hw *);
  480. s32 (*get_info)(struct e1000_hw *);
  481. s32 (*set_page)(struct e1000_hw *, u16);
  482. s32 (*read_reg)(struct e1000_hw *, u32, u16 *);
  483. s32 (*read_reg_locked)(struct e1000_hw *, u32, u16 *);
  484. s32 (*read_reg_page)(struct e1000_hw *, u32, u16 *);
  485. void (*release)(struct e1000_hw *);
  486. s32 (*reset)(struct e1000_hw *);
  487. s32 (*set_d0_lplu_state)(struct e1000_hw *, bool);
  488. s32 (*set_d3_lplu_state)(struct e1000_hw *, bool);
  489. s32 (*write_reg)(struct e1000_hw *, u32, u16);
  490. s32 (*write_reg_locked)(struct e1000_hw *, u32, u16);
  491. s32 (*write_reg_page)(struct e1000_hw *, u32, u16);
  492. void (*power_up)(struct e1000_hw *);
  493. void (*power_down)(struct e1000_hw *);
  494. };
  495. /* Function pointers for the NVM. */
  496. struct e1000_nvm_operations {
  497. s32 (*acquire)(struct e1000_hw *);
  498. s32 (*read)(struct e1000_hw *, u16, u16, u16 *);
  499. void (*release)(struct e1000_hw *);
  500. void (*reload)(struct e1000_hw *);
  501. s32 (*update)(struct e1000_hw *);
  502. s32 (*valid_led_default)(struct e1000_hw *, u16 *);
  503. s32 (*validate)(struct e1000_hw *);
  504. s32 (*write)(struct e1000_hw *, u16, u16, u16 *);
  505. };
  506. struct e1000_mac_info {
  507. struct e1000_mac_operations ops;
  508. u8 addr[ETH_ALEN];
  509. u8 perm_addr[ETH_ALEN];
  510. enum e1000_mac_type type;
  511. u32 collision_delta;
  512. u32 ledctl_default;
  513. u32 ledctl_mode1;
  514. u32 ledctl_mode2;
  515. u32 mc_filter_type;
  516. u32 tx_packet_delta;
  517. u32 txcw;
  518. u16 current_ifs_val;
  519. u16 ifs_max_val;
  520. u16 ifs_min_val;
  521. u16 ifs_ratio;
  522. u16 ifs_step_size;
  523. u16 mta_reg_count;
  524. /* Maximum size of the MTA register table in all supported adapters */
  525. #define MAX_MTA_REG 128
  526. u32 mta_shadow[MAX_MTA_REG];
  527. u16 rar_entry_count;
  528. u8 forced_speed_duplex;
  529. bool adaptive_ifs;
  530. bool has_fwsm;
  531. bool arc_subsystem_valid;
  532. bool autoneg;
  533. bool autoneg_failed;
  534. bool get_link_status;
  535. bool in_ifs_mode;
  536. bool serdes_has_link;
  537. bool tx_pkt_filtering;
  538. enum e1000_serdes_link_state serdes_link_state;
  539. };
  540. struct e1000_phy_info {
  541. struct e1000_phy_operations ops;
  542. enum e1000_phy_type type;
  543. enum e1000_1000t_rx_status local_rx;
  544. enum e1000_1000t_rx_status remote_rx;
  545. enum e1000_ms_type ms_type;
  546. enum e1000_ms_type original_ms_type;
  547. enum e1000_rev_polarity cable_polarity;
  548. enum e1000_smart_speed smart_speed;
  549. u32 addr;
  550. u32 id;
  551. u32 reset_delay_us; /* in usec */
  552. u32 revision;
  553. enum e1000_media_type media_type;
  554. u16 autoneg_advertised;
  555. u16 autoneg_mask;
  556. u16 cable_length;
  557. u16 max_cable_length;
  558. u16 min_cable_length;
  559. u8 mdix;
  560. bool disable_polarity_correction;
  561. bool is_mdix;
  562. bool polarity_correction;
  563. bool speed_downgraded;
  564. bool autoneg_wait_to_complete;
  565. };
  566. struct e1000_nvm_info {
  567. struct e1000_nvm_operations ops;
  568. enum e1000_nvm_type type;
  569. enum e1000_nvm_override override;
  570. u32 flash_bank_size;
  571. u32 flash_base_addr;
  572. u16 word_size;
  573. u16 delay_usec;
  574. u16 address_bits;
  575. u16 opcode_bits;
  576. u16 page_size;
  577. };
  578. struct e1000_bus_info {
  579. enum e1000_bus_width width;
  580. u16 func;
  581. };
  582. struct e1000_fc_info {
  583. u32 high_water; /* Flow control high-water mark */
  584. u32 low_water; /* Flow control low-water mark */
  585. u16 pause_time; /* Flow control pause timer */
  586. u16 refresh_time; /* Flow control refresh timer */
  587. bool send_xon; /* Flow control send XON */
  588. bool strict_ieee; /* Strict IEEE mode */
  589. enum e1000_fc_mode current_mode; /* FC mode in effect */
  590. enum e1000_fc_mode requested_mode; /* FC mode requested by caller */
  591. };
  592. struct e1000_dev_spec_82571 {
  593. bool laa_is_present;
  594. u32 smb_counter;
  595. };
  596. struct e1000_dev_spec_80003es2lan {
  597. bool mdic_wa_enable;
  598. };
  599. struct e1000_shadow_ram {
  600. u16 value;
  601. bool modified;
  602. };
  603. #define E1000_ICH8_SHADOW_RAM_WORDS 2048
  604. /* I218 PHY Ultra Low Power (ULP) states */
  605. enum e1000_ulp_state {
  606. e1000_ulp_state_unknown,
  607. e1000_ulp_state_off,
  608. e1000_ulp_state_on,
  609. };
  610. struct e1000_dev_spec_ich8lan {
  611. bool kmrn_lock_loss_workaround_enabled;
  612. struct e1000_shadow_ram shadow_ram[E1000_ICH8_SHADOW_RAM_WORDS];
  613. bool nvm_k1_enabled;
  614. bool eee_disable;
  615. u16 eee_lp_ability;
  616. enum e1000_ulp_state ulp_state;
  617. };
  618. struct e1000_hw {
  619. struct e1000_adapter *adapter;
  620. void __iomem *hw_addr;
  621. void __iomem *flash_address;
  622. struct e1000_mac_info mac;
  623. struct e1000_fc_info fc;
  624. struct e1000_phy_info phy;
  625. struct e1000_nvm_info nvm;
  626. struct e1000_bus_info bus;
  627. struct e1000_host_mng_dhcp_cookie mng_cookie;
  628. union {
  629. struct e1000_dev_spec_82571 e82571;
  630. struct e1000_dev_spec_80003es2lan e80003es2lan;
  631. struct e1000_dev_spec_ich8lan ich8lan;
  632. } dev_spec;
  633. };
  634. #include "82571.h"
  635. #include "80003es2lan.h"
  636. #include "ich8lan.h"
  637. #endif