hw.h 17 KB

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