hw.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692
  1. /* Intel PRO/1000 Linux driver
  2. * Copyright(c) 1999 - 2014 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_REVISION_4 4
  87. #define E1000_FUNC_1 1
  88. #define E1000_ALT_MAC_ADDRESS_OFFSET_LAN0 0
  89. #define E1000_ALT_MAC_ADDRESS_OFFSET_LAN1 3
  90. enum e1000_mac_type {
  91. e1000_82571,
  92. e1000_82572,
  93. e1000_82573,
  94. e1000_82574,
  95. e1000_82583,
  96. e1000_80003es2lan,
  97. e1000_ich8lan,
  98. e1000_ich9lan,
  99. e1000_ich10lan,
  100. e1000_pchlan,
  101. e1000_pch2lan,
  102. e1000_pch_lpt,
  103. };
  104. enum e1000_media_type {
  105. e1000_media_type_unknown = 0,
  106. e1000_media_type_copper = 1,
  107. e1000_media_type_fiber = 2,
  108. e1000_media_type_internal_serdes = 3,
  109. e1000_num_media_types
  110. };
  111. enum e1000_nvm_type {
  112. e1000_nvm_unknown = 0,
  113. e1000_nvm_none,
  114. e1000_nvm_eeprom_spi,
  115. e1000_nvm_flash_hw,
  116. e1000_nvm_flash_sw
  117. };
  118. enum e1000_nvm_override {
  119. e1000_nvm_override_none = 0,
  120. e1000_nvm_override_spi_small,
  121. e1000_nvm_override_spi_large
  122. };
  123. enum e1000_phy_type {
  124. e1000_phy_unknown = 0,
  125. e1000_phy_none,
  126. e1000_phy_m88,
  127. e1000_phy_igp,
  128. e1000_phy_igp_2,
  129. e1000_phy_gg82563,
  130. e1000_phy_igp_3,
  131. e1000_phy_ife,
  132. e1000_phy_bm,
  133. e1000_phy_82578,
  134. e1000_phy_82577,
  135. e1000_phy_82579,
  136. e1000_phy_i217,
  137. };
  138. enum e1000_bus_width {
  139. e1000_bus_width_unknown = 0,
  140. e1000_bus_width_pcie_x1,
  141. e1000_bus_width_pcie_x2,
  142. e1000_bus_width_pcie_x4 = 4,
  143. e1000_bus_width_32,
  144. e1000_bus_width_64,
  145. e1000_bus_width_reserved
  146. };
  147. enum e1000_1000t_rx_status {
  148. e1000_1000t_rx_status_not_ok = 0,
  149. e1000_1000t_rx_status_ok,
  150. e1000_1000t_rx_status_undefined = 0xFF
  151. };
  152. enum e1000_rev_polarity {
  153. e1000_rev_polarity_normal = 0,
  154. e1000_rev_polarity_reversed,
  155. e1000_rev_polarity_undefined = 0xFF
  156. };
  157. enum e1000_fc_mode {
  158. e1000_fc_none = 0,
  159. e1000_fc_rx_pause,
  160. e1000_fc_tx_pause,
  161. e1000_fc_full,
  162. e1000_fc_default = 0xFF
  163. };
  164. enum e1000_ms_type {
  165. e1000_ms_hw_default = 0,
  166. e1000_ms_force_master,
  167. e1000_ms_force_slave,
  168. e1000_ms_auto
  169. };
  170. enum e1000_smart_speed {
  171. e1000_smart_speed_default = 0,
  172. e1000_smart_speed_on,
  173. e1000_smart_speed_off
  174. };
  175. enum e1000_serdes_link_state {
  176. e1000_serdes_link_down = 0,
  177. e1000_serdes_link_autoneg_progress,
  178. e1000_serdes_link_autoneg_complete,
  179. e1000_serdes_link_forced_up
  180. };
  181. /* Receive Descriptor - Extended */
  182. union e1000_rx_desc_extended {
  183. struct {
  184. __le64 buffer_addr;
  185. __le64 reserved;
  186. } read;
  187. struct {
  188. struct {
  189. __le32 mrq; /* Multiple Rx Queues */
  190. union {
  191. __le32 rss; /* RSS Hash */
  192. struct {
  193. __le16 ip_id; /* IP id */
  194. __le16 csum; /* Packet Checksum */
  195. } csum_ip;
  196. } hi_dword;
  197. } lower;
  198. struct {
  199. __le32 status_error; /* ext status/error */
  200. __le16 length;
  201. __le16 vlan; /* VLAN tag */
  202. } upper;
  203. } wb; /* writeback */
  204. };
  205. #define MAX_PS_BUFFERS 4
  206. /* Number of packet split data buffers (not including the header buffer) */
  207. #define PS_PAGE_BUFFERS (MAX_PS_BUFFERS - 1)
  208. /* Receive Descriptor - Packet Split */
  209. union e1000_rx_desc_packet_split {
  210. struct {
  211. /* one buffer for protocol header(s), three data buffers */
  212. __le64 buffer_addr[MAX_PS_BUFFERS];
  213. } read;
  214. struct {
  215. struct {
  216. __le32 mrq; /* Multiple Rx Queues */
  217. union {
  218. __le32 rss; /* RSS Hash */
  219. struct {
  220. __le16 ip_id; /* IP id */
  221. __le16 csum; /* Packet Checksum */
  222. } csum_ip;
  223. } hi_dword;
  224. } lower;
  225. struct {
  226. __le32 status_error; /* ext status/error */
  227. __le16 length0; /* length of buffer 0 */
  228. __le16 vlan; /* VLAN tag */
  229. } middle;
  230. struct {
  231. __le16 header_status;
  232. /* length of buffers 1-3 */
  233. __le16 length[PS_PAGE_BUFFERS];
  234. } upper;
  235. __le64 reserved;
  236. } wb; /* writeback */
  237. };
  238. /* Transmit Descriptor */
  239. struct e1000_tx_desc {
  240. __le64 buffer_addr; /* Address of the descriptor's data buffer */
  241. union {
  242. __le32 data;
  243. struct {
  244. __le16 length; /* Data buffer length */
  245. u8 cso; /* Checksum offset */
  246. u8 cmd; /* Descriptor control */
  247. } flags;
  248. } lower;
  249. union {
  250. __le32 data;
  251. struct {
  252. u8 status; /* Descriptor status */
  253. u8 css; /* Checksum start */
  254. __le16 special;
  255. } fields;
  256. } upper;
  257. };
  258. /* Offload Context Descriptor */
  259. struct e1000_context_desc {
  260. union {
  261. __le32 ip_config;
  262. struct {
  263. u8 ipcss; /* IP checksum start */
  264. u8 ipcso; /* IP checksum offset */
  265. __le16 ipcse; /* IP checksum end */
  266. } ip_fields;
  267. } lower_setup;
  268. union {
  269. __le32 tcp_config;
  270. struct {
  271. u8 tucss; /* TCP checksum start */
  272. u8 tucso; /* TCP checksum offset */
  273. __le16 tucse; /* TCP checksum end */
  274. } tcp_fields;
  275. } upper_setup;
  276. __le32 cmd_and_length;
  277. union {
  278. __le32 data;
  279. struct {
  280. u8 status; /* Descriptor status */
  281. u8 hdr_len; /* Header length */
  282. __le16 mss; /* Maximum segment size */
  283. } fields;
  284. } tcp_seg_setup;
  285. };
  286. /* Offload data descriptor */
  287. struct e1000_data_desc {
  288. __le64 buffer_addr; /* Address of the descriptor's buffer address */
  289. union {
  290. __le32 data;
  291. struct {
  292. __le16 length; /* Data buffer length */
  293. u8 typ_len_ext;
  294. u8 cmd;
  295. } flags;
  296. } lower;
  297. union {
  298. __le32 data;
  299. struct {
  300. u8 status; /* Descriptor status */
  301. u8 popts; /* Packet Options */
  302. __le16 special;
  303. } fields;
  304. } upper;
  305. };
  306. /* Statistics counters collected by the MAC */
  307. struct e1000_hw_stats {
  308. u64 crcerrs;
  309. u64 algnerrc;
  310. u64 symerrs;
  311. u64 rxerrc;
  312. u64 mpc;
  313. u64 scc;
  314. u64 ecol;
  315. u64 mcc;
  316. u64 latecol;
  317. u64 colc;
  318. u64 dc;
  319. u64 tncrs;
  320. u64 sec;
  321. u64 cexterr;
  322. u64 rlec;
  323. u64 xonrxc;
  324. u64 xontxc;
  325. u64 xoffrxc;
  326. u64 xofftxc;
  327. u64 fcruc;
  328. u64 prc64;
  329. u64 prc127;
  330. u64 prc255;
  331. u64 prc511;
  332. u64 prc1023;
  333. u64 prc1522;
  334. u64 gprc;
  335. u64 bprc;
  336. u64 mprc;
  337. u64 gptc;
  338. u64 gorc;
  339. u64 gotc;
  340. u64 rnbc;
  341. u64 ruc;
  342. u64 rfc;
  343. u64 roc;
  344. u64 rjc;
  345. u64 mgprc;
  346. u64 mgpdc;
  347. u64 mgptc;
  348. u64 tor;
  349. u64 tot;
  350. u64 tpr;
  351. u64 tpt;
  352. u64 ptc64;
  353. u64 ptc127;
  354. u64 ptc255;
  355. u64 ptc511;
  356. u64 ptc1023;
  357. u64 ptc1522;
  358. u64 mptc;
  359. u64 bptc;
  360. u64 tsctc;
  361. u64 tsctfc;
  362. u64 iac;
  363. u64 icrxptc;
  364. u64 icrxatc;
  365. u64 ictxptc;
  366. u64 ictxatc;
  367. u64 ictxqec;
  368. u64 ictxqmtc;
  369. u64 icrxdmtc;
  370. u64 icrxoc;
  371. };
  372. struct e1000_phy_stats {
  373. u32 idle_errors;
  374. u32 receive_errors;
  375. };
  376. struct e1000_host_mng_dhcp_cookie {
  377. u32 signature;
  378. u8 status;
  379. u8 reserved0;
  380. u16 vlan_id;
  381. u32 reserved1;
  382. u16 reserved2;
  383. u8 reserved3;
  384. u8 checksum;
  385. };
  386. /* Host Interface "Rev 1" */
  387. struct e1000_host_command_header {
  388. u8 command_id;
  389. u8 command_length;
  390. u8 command_options;
  391. u8 checksum;
  392. };
  393. #define E1000_HI_MAX_DATA_LENGTH 252
  394. struct e1000_host_command_info {
  395. struct e1000_host_command_header command_header;
  396. u8 command_data[E1000_HI_MAX_DATA_LENGTH];
  397. };
  398. /* Host Interface "Rev 2" */
  399. struct e1000_host_mng_command_header {
  400. u8 command_id;
  401. u8 checksum;
  402. u16 reserved1;
  403. u16 reserved2;
  404. u16 command_length;
  405. };
  406. #define E1000_HI_MAX_MNG_DATA_LENGTH 0x6F8
  407. struct e1000_host_mng_command_info {
  408. struct e1000_host_mng_command_header command_header;
  409. u8 command_data[E1000_HI_MAX_MNG_DATA_LENGTH];
  410. };
  411. #include "mac.h"
  412. #include "phy.h"
  413. #include "nvm.h"
  414. #include "manage.h"
  415. /* Function pointers for the MAC. */
  416. struct e1000_mac_operations {
  417. s32 (*id_led_init)(struct e1000_hw *);
  418. s32 (*blink_led)(struct e1000_hw *);
  419. bool (*check_mng_mode)(struct e1000_hw *);
  420. s32 (*check_for_link)(struct e1000_hw *);
  421. s32 (*cleanup_led)(struct e1000_hw *);
  422. void (*clear_hw_cntrs)(struct e1000_hw *);
  423. void (*clear_vfta)(struct e1000_hw *);
  424. s32 (*get_bus_info)(struct e1000_hw *);
  425. void (*set_lan_id)(struct e1000_hw *);
  426. s32 (*get_link_up_info)(struct e1000_hw *, u16 *, u16 *);
  427. s32 (*led_on)(struct e1000_hw *);
  428. s32 (*led_off)(struct e1000_hw *);
  429. void (*update_mc_addr_list)(struct e1000_hw *, u8 *, u32);
  430. s32 (*reset_hw)(struct e1000_hw *);
  431. s32 (*init_hw)(struct e1000_hw *);
  432. s32 (*setup_link)(struct e1000_hw *);
  433. s32 (*setup_physical_interface)(struct e1000_hw *);
  434. s32 (*setup_led)(struct e1000_hw *);
  435. void (*write_vfta)(struct e1000_hw *, u32, u32);
  436. void (*config_collision_dist)(struct e1000_hw *);
  437. int (*rar_set)(struct e1000_hw *, u8 *, u32);
  438. s32 (*read_mac_addr)(struct e1000_hw *);
  439. u32 (*rar_get_count)(struct e1000_hw *);
  440. };
  441. /* When to use various PHY register access functions:
  442. *
  443. * Func Caller
  444. * Function Does Does When to use
  445. * ~~~~~~~~~~~~ ~~~~~ ~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  446. * X_reg L,P,A n/a for simple PHY reg accesses
  447. * X_reg_locked P,A L for multiple accesses of different regs
  448. * on different pages
  449. * X_reg_page A L,P for multiple accesses of different regs
  450. * on the same page
  451. *
  452. * Where X=[read|write], L=locking, P=sets page, A=register access
  453. *
  454. */
  455. struct e1000_phy_operations {
  456. s32 (*acquire)(struct e1000_hw *);
  457. s32 (*cfg_on_link_up)(struct e1000_hw *);
  458. s32 (*check_polarity)(struct e1000_hw *);
  459. s32 (*check_reset_block)(struct e1000_hw *);
  460. s32 (*commit)(struct e1000_hw *);
  461. s32 (*force_speed_duplex)(struct e1000_hw *);
  462. s32 (*get_cfg_done)(struct e1000_hw *hw);
  463. s32 (*get_cable_length)(struct e1000_hw *);
  464. s32 (*get_info)(struct e1000_hw *);
  465. s32 (*set_page)(struct e1000_hw *, u16);
  466. s32 (*read_reg)(struct e1000_hw *, u32, u16 *);
  467. s32 (*read_reg_locked)(struct e1000_hw *, u32, u16 *);
  468. s32 (*read_reg_page)(struct e1000_hw *, u32, u16 *);
  469. void (*release)(struct e1000_hw *);
  470. s32 (*reset)(struct e1000_hw *);
  471. s32 (*set_d0_lplu_state)(struct e1000_hw *, bool);
  472. s32 (*set_d3_lplu_state)(struct e1000_hw *, bool);
  473. s32 (*write_reg)(struct e1000_hw *, u32, u16);
  474. s32 (*write_reg_locked)(struct e1000_hw *, u32, u16);
  475. s32 (*write_reg_page)(struct e1000_hw *, u32, u16);
  476. void (*power_up)(struct e1000_hw *);
  477. void (*power_down)(struct e1000_hw *);
  478. };
  479. /* Function pointers for the NVM. */
  480. struct e1000_nvm_operations {
  481. s32 (*acquire)(struct e1000_hw *);
  482. s32 (*read)(struct e1000_hw *, u16, u16, u16 *);
  483. void (*release)(struct e1000_hw *);
  484. void (*reload)(struct e1000_hw *);
  485. s32 (*update)(struct e1000_hw *);
  486. s32 (*valid_led_default)(struct e1000_hw *, u16 *);
  487. s32 (*validate)(struct e1000_hw *);
  488. s32 (*write)(struct e1000_hw *, u16, u16, u16 *);
  489. };
  490. struct e1000_mac_info {
  491. struct e1000_mac_operations ops;
  492. u8 addr[ETH_ALEN];
  493. u8 perm_addr[ETH_ALEN];
  494. enum e1000_mac_type type;
  495. u32 collision_delta;
  496. u32 ledctl_default;
  497. u32 ledctl_mode1;
  498. u32 ledctl_mode2;
  499. u32 mc_filter_type;
  500. u32 tx_packet_delta;
  501. u32 txcw;
  502. u16 current_ifs_val;
  503. u16 ifs_max_val;
  504. u16 ifs_min_val;
  505. u16 ifs_ratio;
  506. u16 ifs_step_size;
  507. u16 mta_reg_count;
  508. /* Maximum size of the MTA register table in all supported adapters */
  509. #define MAX_MTA_REG 128
  510. u32 mta_shadow[MAX_MTA_REG];
  511. u16 rar_entry_count;
  512. u8 forced_speed_duplex;
  513. bool adaptive_ifs;
  514. bool has_fwsm;
  515. bool arc_subsystem_valid;
  516. bool autoneg;
  517. bool autoneg_failed;
  518. bool get_link_status;
  519. bool in_ifs_mode;
  520. bool serdes_has_link;
  521. bool tx_pkt_filtering;
  522. enum e1000_serdes_link_state serdes_link_state;
  523. };
  524. struct e1000_phy_info {
  525. struct e1000_phy_operations ops;
  526. enum e1000_phy_type type;
  527. enum e1000_1000t_rx_status local_rx;
  528. enum e1000_1000t_rx_status remote_rx;
  529. enum e1000_ms_type ms_type;
  530. enum e1000_ms_type original_ms_type;
  531. enum e1000_rev_polarity cable_polarity;
  532. enum e1000_smart_speed smart_speed;
  533. u32 addr;
  534. u32 id;
  535. u32 reset_delay_us; /* in usec */
  536. u32 revision;
  537. enum e1000_media_type media_type;
  538. u16 autoneg_advertised;
  539. u16 autoneg_mask;
  540. u16 cable_length;
  541. u16 max_cable_length;
  542. u16 min_cable_length;
  543. u8 mdix;
  544. bool disable_polarity_correction;
  545. bool is_mdix;
  546. bool polarity_correction;
  547. bool speed_downgraded;
  548. bool autoneg_wait_to_complete;
  549. };
  550. struct e1000_nvm_info {
  551. struct e1000_nvm_operations ops;
  552. enum e1000_nvm_type type;
  553. enum e1000_nvm_override override;
  554. u32 flash_bank_size;
  555. u32 flash_base_addr;
  556. u16 word_size;
  557. u16 delay_usec;
  558. u16 address_bits;
  559. u16 opcode_bits;
  560. u16 page_size;
  561. };
  562. struct e1000_bus_info {
  563. enum e1000_bus_width width;
  564. u16 func;
  565. };
  566. struct e1000_fc_info {
  567. u32 high_water; /* Flow control high-water mark */
  568. u32 low_water; /* Flow control low-water mark */
  569. u16 pause_time; /* Flow control pause timer */
  570. u16 refresh_time; /* Flow control refresh timer */
  571. bool send_xon; /* Flow control send XON */
  572. bool strict_ieee; /* Strict IEEE mode */
  573. enum e1000_fc_mode current_mode; /* FC mode in effect */
  574. enum e1000_fc_mode requested_mode; /* FC mode requested by caller */
  575. };
  576. struct e1000_dev_spec_82571 {
  577. bool laa_is_present;
  578. u32 smb_counter;
  579. };
  580. struct e1000_dev_spec_80003es2lan {
  581. bool mdic_wa_enable;
  582. };
  583. struct e1000_shadow_ram {
  584. u16 value;
  585. bool modified;
  586. };
  587. #define E1000_ICH8_SHADOW_RAM_WORDS 2048
  588. /* I218 PHY Ultra Low Power (ULP) states */
  589. enum e1000_ulp_state {
  590. e1000_ulp_state_unknown,
  591. e1000_ulp_state_off,
  592. e1000_ulp_state_on,
  593. };
  594. struct e1000_dev_spec_ich8lan {
  595. bool kmrn_lock_loss_workaround_enabled;
  596. struct e1000_shadow_ram shadow_ram[E1000_ICH8_SHADOW_RAM_WORDS];
  597. bool nvm_k1_enabled;
  598. bool eee_disable;
  599. u16 eee_lp_ability;
  600. enum e1000_ulp_state ulp_state;
  601. };
  602. struct e1000_hw {
  603. struct e1000_adapter *adapter;
  604. void __iomem *hw_addr;
  605. void __iomem *flash_address;
  606. struct e1000_mac_info mac;
  607. struct e1000_fc_info fc;
  608. struct e1000_phy_info phy;
  609. struct e1000_nvm_info nvm;
  610. struct e1000_bus_info bus;
  611. struct e1000_host_mng_dhcp_cookie mng_cookie;
  612. union {
  613. struct e1000_dev_spec_82571 e82571;
  614. struct e1000_dev_spec_80003es2lan e80003es2lan;
  615. struct e1000_dev_spec_ich8lan ich8lan;
  616. } dev_spec;
  617. };
  618. #include "82571.h"
  619. #include "80003es2lan.h"
  620. #include "ich8lan.h"
  621. #endif