hw.h 17 KB

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