Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189
  1. /*
  2. * gPXE driver for Intel eepro1000 ethernet cards
  3. *
  4. * Written by Marty Connor
  5. *
  6. * Copyright Entity Cyber, Inc. 2007
  7. *
  8. * This software may be used and distributed according to the terms of
  9. * the GNU General Public License (GPL), incorporated herein by
  10. * reference. Drivers based on or derived from this code fall under
  11. * the GPL and must retain the authorship, copyright and license
  12. * notice.
  13. *
  14. */
  15. /*******************************************************************************
  16. Intel PRO/1000 Linux driver
  17. Copyright(c) 1999 - 2006 Intel Corporation.
  18. This program is free software; you can redistribute it and/or modify it
  19. under the terms and conditions of the GNU General Public License,
  20. version 2, as published by the Free Software Foundation.
  21. This program is distributed in the hope it will be useful, but WITHOUT
  22. ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  23. FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  24. more details.
  25. You should have received a copy of the GNU General Public License along with
  26. this program; if not, write to the Free Software Foundation, Inc.,
  27. 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
  28. The full GNU General Public License is included in this distribution in
  29. the file called "COPYING".
  30. Contact Information:
  31. Linux NICS <linux.nics@intel.com>
  32. e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
  33. Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
  34. *******************************************************************************/
  35. FILE_LICENCE ( GPL2_ONLY );
  36. #include "e1000.h"
  37. /**
  38. * e1000_get_hw_control - get control of the h/w from f/w
  39. *
  40. * @v adapter e1000 private structure
  41. *
  42. * e1000_get_hw_control sets {CTRL_EXT|FWSM}:DRV_LOAD bit.
  43. * For ASF and Pass Through versions of f/w this means that
  44. * the driver is loaded. For AMT version (only with 82573)
  45. * of the f/w this means that the network i/f is open.
  46. *
  47. **/
  48. static void
  49. e1000_get_hw_control ( struct e1000_adapter *adapter )
  50. {
  51. uint32_t ctrl_ext;
  52. uint32_t swsm;
  53. DBG ( "e1000_get_hw_control\n" );
  54. /* Let firmware know the driver has taken over */
  55. switch (adapter->hw.mac_type) {
  56. case e1000_82573:
  57. swsm = E1000_READ_REG(&adapter->hw, SWSM);
  58. E1000_WRITE_REG(&adapter->hw, SWSM,
  59. swsm | E1000_SWSM_DRV_LOAD);
  60. break;
  61. case e1000_82571:
  62. case e1000_82572:
  63. case e1000_82576:
  64. case e1000_80003es2lan:
  65. case e1000_ich8lan:
  66. ctrl_ext = E1000_READ_REG(&adapter->hw, CTRL_EXT);
  67. E1000_WRITE_REG(&adapter->hw, CTRL_EXT,
  68. ctrl_ext | E1000_CTRL_EXT_DRV_LOAD);
  69. break;
  70. default:
  71. break;
  72. }
  73. }
  74. /**
  75. * e1000_irq_enable - Enable default interrupt generation settings
  76. *
  77. * @v adapter e1000 private structure
  78. **/
  79. static void
  80. e1000_irq_enable ( struct e1000_adapter *adapter )
  81. {
  82. E1000_WRITE_REG ( &adapter->hw, IMS, E1000_IMS_RXDMT0 |
  83. E1000_IMS_RXSEQ );
  84. E1000_WRITE_FLUSH ( &adapter->hw );
  85. }
  86. /**
  87. * e1000_irq_disable - Mask off interrupt generation on the NIC
  88. *
  89. * @v adapter e1000 private structure
  90. **/
  91. static void
  92. e1000_irq_disable ( struct e1000_adapter *adapter )
  93. {
  94. E1000_WRITE_REG ( &adapter->hw, IMC, ~0 );
  95. E1000_WRITE_FLUSH ( &adapter->hw );
  96. }
  97. /**
  98. * e1000_irq_force - trigger interrupt
  99. *
  100. * @v adapter e1000 private structure
  101. **/
  102. static void
  103. e1000_irq_force ( struct e1000_adapter *adapter )
  104. {
  105. E1000_WRITE_REG ( &adapter->hw, ICS, E1000_ICS_RXDMT0 );
  106. E1000_WRITE_FLUSH ( &adapter->hw );
  107. }
  108. /**
  109. * e1000_sw_init - Initialize general software structures (struct e1000_adapter)
  110. *
  111. * @v adapter e1000 private structure
  112. *
  113. * e1000_sw_init initializes the Adapter private data structure.
  114. * Fields are initialized based on PCI device information and
  115. * OS network device settings (MTU size).
  116. **/
  117. static int
  118. e1000_sw_init ( struct e1000_adapter *adapter )
  119. {
  120. struct e1000_hw *hw = &adapter->hw;
  121. struct pci_device *pdev = adapter->pdev;
  122. /* PCI config space info */
  123. hw->vendor_id = pdev->vendor;
  124. hw->device_id = pdev->device;
  125. pci_read_config_word ( pdev, PCI_COMMAND, &hw->pci_cmd_word );
  126. /* Disable Flow Control */
  127. hw->fc = E1000_FC_NONE;
  128. adapter->eeprom_wol = 0;
  129. adapter->wol = adapter->eeprom_wol;
  130. adapter->en_mng_pt = 0;
  131. adapter->rx_int_delay = 0;
  132. adapter->rx_abs_int_delay = 0;
  133. adapter->rx_buffer_len = MAXIMUM_ETHERNET_VLAN_SIZE;
  134. adapter->rx_ps_bsize0 = E1000_RXBUFFER_128;
  135. hw->max_frame_size = MAXIMUM_ETHERNET_VLAN_SIZE +
  136. ENET_HEADER_SIZE + ETHERNET_FCS_SIZE;
  137. hw->min_frame_size = MINIMUM_ETHERNET_FRAME_SIZE;
  138. /* identify the MAC */
  139. if ( e1000_set_mac_type ( hw ) ) {
  140. DBG ( "Unknown MAC Type\n" );
  141. return -EIO;
  142. }
  143. switch ( hw->mac_type ) {
  144. default:
  145. break;
  146. case e1000_82541:
  147. case e1000_82547:
  148. case e1000_82541_rev_2:
  149. case e1000_82547_rev_2:
  150. hw->phy_init_script = 1;
  151. break;
  152. }
  153. e1000_set_media_type ( hw );
  154. hw->autoneg = TRUE;
  155. hw->autoneg_advertised = AUTONEG_ADVERTISE_SPEED_DEFAULT;
  156. hw->wait_autoneg_complete = TRUE;
  157. hw->tbi_compatibility_en = TRUE;
  158. hw->adaptive_ifs = TRUE;
  159. /* Copper options */
  160. if ( hw->media_type == e1000_media_type_copper ) {
  161. hw->mdix = AUTO_ALL_MODES;
  162. hw->disable_polarity_correction = FALSE;
  163. hw->master_slave = E1000_MASTER_SLAVE;
  164. }
  165. e1000_irq_disable ( adapter );
  166. return 0;
  167. }
  168. /**
  169. * e1000_setup_tx_resources - allocate Tx resources (Descriptors)
  170. *
  171. * @v adapter e1000 private structure
  172. *
  173. * @ret rc Returns 0 on success, negative on failure
  174. **/
  175. static int
  176. e1000_setup_tx_resources ( struct e1000_adapter *adapter )
  177. {
  178. DBG ( "e1000_setup_tx_resources\n" );
  179. /* Allocate transmit descriptor ring memory.
  180. It must not cross a 64K boundary because of hardware errata #23
  181. so we use malloc_dma() requesting a 128 byte block that is
  182. 128 byte aligned. This should guarantee that the memory
  183. allocated will not cross a 64K boundary, because 128 is an
  184. even multiple of 65536 ( 65536 / 128 == 512 ), so all possible
  185. allocations of 128 bytes on a 128 byte boundary will not
  186. cross 64K bytes.
  187. */
  188. adapter->tx_base =
  189. malloc_dma ( adapter->tx_ring_size, adapter->tx_ring_size );
  190. if ( ! adapter->tx_base ) {
  191. return -ENOMEM;
  192. }
  193. memset ( adapter->tx_base, 0, adapter->tx_ring_size );
  194. DBG ( "adapter->tx_base = %#08lx\n", virt_to_bus ( adapter->tx_base ) );
  195. return 0;
  196. }
  197. static void
  198. e1000_free_tx_resources ( struct e1000_adapter *adapter )
  199. {
  200. DBG ( "e1000_free_tx_resources\n" );
  201. free_dma ( adapter->tx_base, adapter->tx_ring_size );
  202. }
  203. /**
  204. * e1000_configure_tx - Configure 8254x Transmit Unit after Reset
  205. * @adapter: board private structure
  206. *
  207. * Configure the Tx unit of the MAC after a reset.
  208. **/
  209. static void
  210. e1000_configure_tx ( struct e1000_adapter *adapter )
  211. {
  212. struct e1000_hw *hw = &adapter->hw;
  213. uint32_t tctl;
  214. uint32_t txdctl;
  215. DBG ( "e1000_configure_tx\n" );
  216. E1000_WRITE_REG ( hw, TDBAH, 0 );
  217. E1000_WRITE_REG ( hw, TDBAL, virt_to_bus ( adapter->tx_base ) );
  218. E1000_WRITE_REG ( hw, TDLEN, adapter->tx_ring_size );
  219. DBG ( "TDBAL: %#08x\n", E1000_READ_REG ( hw, TDBAL ) );
  220. DBG ( "TDLEN: %d\n", E1000_READ_REG ( hw, TDLEN ) );
  221. /* Setup the HW Tx Head and Tail descriptor pointers */
  222. E1000_WRITE_REG ( hw, TDH, 0 );
  223. E1000_WRITE_REG ( hw, TDT, 0 );
  224. adapter->tx_head = 0;
  225. adapter->tx_tail = 0;
  226. adapter->tx_fill_ctr = 0;
  227. if (hw->mac_type == e1000_82576) {
  228. txdctl = E1000_READ_REG ( hw, TXDCTL );
  229. txdctl |= E1000_TXDCTL_QUEUE_ENABLE;
  230. E1000_WRITE_REG ( hw, TXDCTL, txdctl );
  231. }
  232. /* Setup Transmit Descriptor Settings for eop descriptor */
  233. tctl = E1000_TCTL_PSP | E1000_TCTL_EN |
  234. (E1000_COLLISION_THRESHOLD << E1000_CT_SHIFT) |
  235. (E1000_HDX_COLLISION_DISTANCE << E1000_COLD_SHIFT);
  236. e1000_config_collision_dist ( hw );
  237. E1000_WRITE_REG ( hw, TCTL, tctl );
  238. E1000_WRITE_FLUSH ( hw );
  239. }
  240. /**
  241. * e1000_setup_rx_resources - allocate Rx resources (Descriptors)
  242. *
  243. * @v adapter e1000 private structure
  244. *
  245. * @ret rc Returns 0 on success, negative on failure
  246. **/
  247. static int
  248. e1000_setup_rx_resources ( struct e1000_adapter *adapter )
  249. {
  250. int i, j;
  251. struct e1000_rx_desc *rx_curr_desc;
  252. DBG ( "e1000_setup_rx_resources\n" );
  253. /* Allocate receive descriptor ring memory.
  254. It must not cross a 64K boundary because of hardware errata
  255. */
  256. adapter->rx_base =
  257. malloc_dma ( adapter->rx_ring_size, adapter->rx_ring_size );
  258. if ( ! adapter->rx_base ) {
  259. return -ENOMEM;
  260. }
  261. memset ( adapter->rx_base, 0, adapter->rx_ring_size );
  262. for ( i = 0; i < NUM_RX_DESC; i++ ) {
  263. adapter->rx_iobuf[i] = alloc_iob ( MAXIMUM_ETHERNET_VLAN_SIZE );
  264. /* If unable to allocate all iobufs, free any that
  265. * were successfully allocated, and return an error
  266. */
  267. if ( ! adapter->rx_iobuf[i] ) {
  268. for ( j = 0; j < i; j++ ) {
  269. free_iob ( adapter->rx_iobuf[j] );
  270. }
  271. return -ENOMEM;
  272. }
  273. rx_curr_desc = ( void * ) ( adapter->rx_base ) +
  274. ( i * sizeof ( *adapter->rx_base ) );
  275. rx_curr_desc->buffer_addr = virt_to_bus ( adapter->rx_iobuf[i]->data );
  276. DBG ( "i = %d rx_curr_desc->buffer_addr = %#16llx\n",
  277. i, rx_curr_desc->buffer_addr );
  278. }
  279. return 0;
  280. }
  281. static void
  282. e1000_free_rx_resources ( struct e1000_adapter *adapter )
  283. {
  284. int i;
  285. DBG ( "e1000_free_rx_resources\n" );
  286. free_dma ( adapter->rx_base, adapter->rx_ring_size );
  287. for ( i = 0; i < NUM_RX_DESC; i++ ) {
  288. free_iob ( adapter->rx_iobuf[i] );
  289. }
  290. }
  291. /**
  292. * e1000_configure_rx - Configure 8254x Receive Unit after Reset
  293. * @adapter: board private structure
  294. *
  295. * Configure the Rx unit of the MAC after a reset.
  296. **/
  297. static void
  298. e1000_configure_rx ( struct e1000_adapter *adapter )
  299. {
  300. struct e1000_hw *hw = &adapter->hw;
  301. uint32_t rctl, rxdctl, mrqc, rxcsum;
  302. DBG ( "e1000_configure_rx\n" );
  303. /* disable receives while setting up the descriptors */
  304. rctl = E1000_READ_REG ( hw, RCTL );
  305. E1000_WRITE_REG ( hw, RCTL, rctl & ~E1000_RCTL_EN );
  306. E1000_WRITE_FLUSH ( hw );
  307. mdelay(10);
  308. adapter->rx_curr = 0;
  309. /* Setup the HW Rx Head and Tail Descriptor Pointers and
  310. * the Base and Length of the Rx Descriptor Ring */
  311. E1000_WRITE_REG ( hw, RDBAL, virt_to_bus ( adapter->rx_base ) );
  312. E1000_WRITE_REG ( hw, RDBAH, 0 );
  313. E1000_WRITE_REG ( hw, RDLEN, adapter->rx_ring_size );
  314. E1000_WRITE_REG ( hw, RDH, 0 );
  315. if (hw->mac_type == e1000_82576)
  316. E1000_WRITE_REG ( hw, RDT, 0 );
  317. else
  318. E1000_WRITE_REG ( hw, RDT, NUM_RX_DESC - 1 );
  319. /* This doesn't seem to be necessary for correct operation,
  320. * but it seems as well to be implicit
  321. */
  322. if (hw->mac_type == e1000_82576) {
  323. rxdctl = E1000_READ_REG ( hw, RXDCTL );
  324. rxdctl |= E1000_RXDCTL_QUEUE_ENABLE;
  325. rxdctl &= 0xFFF00000;
  326. rxdctl |= IGB_RX_PTHRESH;
  327. rxdctl |= IGB_RX_HTHRESH << 8;
  328. rxdctl |= IGB_RX_WTHRESH << 16;
  329. E1000_WRITE_REG ( hw, RXDCTL, rxdctl );
  330. E1000_WRITE_FLUSH ( hw );
  331. rxcsum = E1000_READ_REG(hw, RXCSUM);
  332. rxcsum &= ~( E1000_RXCSUM_TUOFL | E1000_RXCSUM_IPPCSE );
  333. E1000_WRITE_REG ( hw, RXCSUM, 0 );
  334. /* The initial value for MRQC disables multiple receive
  335. * queues, however this setting is not recommended.
  336. * - Intel® 82576 Gigabit Ethernet Controller Datasheet r2.41
  337. * Section 8.10.9 Multiple Queues Command Register - MRQC
  338. */
  339. mrqc = E1000_MRQC_ENABLE_VMDQ;
  340. E1000_WRITE_REG ( hw, MRQC, mrqc );
  341. }
  342. /* Enable Receives */
  343. rctl |= E1000_RCTL_EN | E1000_RCTL_BAM | E1000_RCTL_SZ_2048 |
  344. E1000_RCTL_MPE;
  345. E1000_WRITE_REG ( hw, RCTL, rctl );
  346. E1000_WRITE_FLUSH ( hw );
  347. /* On the 82576, RDT([0]) must not be "bumped" before
  348. * the enable bit of RXDCTL([0]) is set.
  349. * - Intel® 82576 Gigabit Ethernet Controller Datasheet r2.41
  350. * Section 4.5.9 receive Initialization
  351. *
  352. * By observation I have found to occur when the enable bit of
  353. * RCTL is set. The datasheet recommends polling for this bit,
  354. * however as I see no evidence of this in the Linux igb driver
  355. * I have omitted that step.
  356. * - Simon Horman, May 2009
  357. */
  358. if (hw->mac_type == e1000_82576)
  359. E1000_WRITE_REG ( hw, RDT, NUM_RX_DESC - 1 );
  360. DBG ( "RDBAL: %#08x\n", E1000_READ_REG ( hw, RDBAL ) );
  361. DBG ( "RDLEN: %d\n", E1000_READ_REG ( hw, RDLEN ) );
  362. DBG ( "RCTL: %#08x\n", E1000_READ_REG ( hw, RCTL ) );
  363. }
  364. /**
  365. * e1000_reset - Put e1000 NIC in known initial state
  366. *
  367. * @v adapter e1000 private structure
  368. **/
  369. static void
  370. e1000_reset ( struct e1000_adapter *adapter )
  371. {
  372. uint32_t pba = 0;
  373. uint16_t fc_high_water_mark = E1000_FC_HIGH_DIFF;
  374. DBG ( "e1000_reset\n" );
  375. switch (adapter->hw.mac_type) {
  376. case e1000_82542_rev2_0:
  377. case e1000_82542_rev2_1:
  378. case e1000_82543:
  379. case e1000_82544:
  380. case e1000_82540:
  381. case e1000_82541:
  382. case e1000_82541_rev_2:
  383. pba = E1000_PBA_48K;
  384. break;
  385. case e1000_82545:
  386. case e1000_82545_rev_3:
  387. case e1000_82546:
  388. case e1000_82546_rev_3:
  389. pba = E1000_PBA_48K;
  390. break;
  391. case e1000_82547:
  392. case e1000_82547_rev_2:
  393. pba = E1000_PBA_30K;
  394. break;
  395. case e1000_82571:
  396. case e1000_82572:
  397. case e1000_80003es2lan:
  398. pba = E1000_PBA_38K;
  399. break;
  400. case e1000_82573:
  401. pba = E1000_PBA_20K;
  402. break;
  403. case e1000_82576:
  404. pba = E1000_PBA_64K;
  405. break;
  406. case e1000_ich8lan:
  407. pba = E1000_PBA_8K;
  408. case e1000_undefined:
  409. case e1000_num_macs:
  410. break;
  411. }
  412. E1000_WRITE_REG ( &adapter->hw, PBA, pba );
  413. /* flow control settings */
  414. /* Set the FC high water mark to 90% of the FIFO size.
  415. * Required to clear last 3 LSB */
  416. fc_high_water_mark = ((pba * 9216)/10) & 0xFFF8;
  417. /* We can't use 90% on small FIFOs because the remainder
  418. * would be less than 1 full frame. In this case, we size
  419. * it to allow at least a full frame above the high water
  420. * mark. */
  421. if (pba < E1000_PBA_16K)
  422. fc_high_water_mark = (pba * 1024) - 1600;
  423. /* This actually applies to < e1000_82575, one revision less than
  424. * e1000_82576, but e1000_82575 isn't currently defined in the code */
  425. if (adapter->hw.mac_type < e1000_82576) {
  426. /* 8-byte granularity */
  427. adapter->hw.fc_high_water = fc_high_water_mark & 0xFFF8;
  428. adapter->hw.fc_low_water = adapter->hw.fc_high_water - 8;
  429. } else {
  430. /* 16-byte granularity */
  431. adapter->hw.fc_high_water = fc_high_water_mark & 0xFFF0;
  432. adapter->hw.fc_low_water = adapter->hw.fc_high_water - 16;
  433. }
  434. if (adapter->hw.mac_type == e1000_80003es2lan ||
  435. adapter->hw.mac_type == e1000_82576)
  436. adapter->hw.fc_pause_time = 0xFFFF;
  437. else
  438. adapter->hw.fc_pause_time = E1000_FC_PAUSE_TIME;
  439. adapter->hw.fc_send_xon = 1;
  440. adapter->hw.fc = adapter->hw.original_fc;
  441. /* Allow time for pending master requests to run */
  442. e1000_reset_hw ( &adapter->hw );
  443. if ( adapter->hw.mac_type >= e1000_82544 )
  444. E1000_WRITE_REG ( &adapter->hw, WUC, 0 );
  445. if ( e1000_init_hw ( &adapter->hw ) )
  446. DBG ( "Hardware Error\n" );
  447. /* if (adapter->hwflags & HWFLAGS_PHY_PWR_BIT) { */
  448. if (adapter->hw.mac_type >= e1000_82544 &&
  449. adapter->hw.mac_type <= e1000_82547_rev_2 &&
  450. adapter->hw.autoneg == 1 &&
  451. adapter->hw.autoneg_advertised == ADVERTISE_1000_FULL) {
  452. uint32_t ctrl = E1000_READ_REG(&adapter->hw, CTRL);
  453. /* clear phy power management bit if we are in gig only mode,
  454. * which if enabled will attempt negotiation to 100Mb, which
  455. * can cause a loss of link at power off or driver unload */
  456. ctrl &= ~E1000_CTRL_SWDPIN3;
  457. E1000_WRITE_REG(&adapter->hw, CTRL, ctrl);
  458. }
  459. e1000_phy_get_info ( &adapter->hw, &adapter->phy_info );
  460. if (!adapter->smart_power_down &&
  461. (adapter->hw.mac_type == e1000_82571 ||
  462. adapter->hw.mac_type == e1000_82572)) {
  463. uint16_t phy_data = 0;
  464. /* speed up time to link by disabling smart power down, ignore
  465. * the return value of this function because there is nothing
  466. * different we would do if it failed */
  467. e1000_read_phy_reg(&adapter->hw, IGP02E1000_PHY_POWER_MGMT,
  468. &phy_data);
  469. phy_data &= ~IGP02E1000_PM_SPD;
  470. e1000_write_phy_reg(&adapter->hw, IGP02E1000_PHY_POWER_MGMT,
  471. phy_data);
  472. }
  473. }
  474. /** Functions that implement the gPXE driver API **/
  475. /**
  476. * e1000_close - Disables a network interface
  477. *
  478. * @v netdev network interface device structure
  479. *
  480. **/
  481. static void
  482. e1000_close ( struct net_device *netdev )
  483. {
  484. struct e1000_adapter *adapter = netdev_priv ( netdev );
  485. struct e1000_hw *hw = &adapter->hw;
  486. uint32_t rctl;
  487. uint32_t icr;
  488. DBG ( "e1000_close\n" );
  489. /* Acknowledge interrupts */
  490. icr = E1000_READ_REG ( hw, ICR );
  491. e1000_irq_disable ( adapter );
  492. /* disable receives */
  493. rctl = E1000_READ_REG ( hw, RCTL );
  494. E1000_WRITE_REG ( hw, RCTL, rctl & ~E1000_RCTL_EN );
  495. E1000_WRITE_FLUSH ( hw );
  496. e1000_reset_hw ( hw );
  497. e1000_free_tx_resources ( adapter );
  498. e1000_free_rx_resources ( adapter );
  499. }
  500. /**
  501. * e1000_transmit - Transmit a packet
  502. *
  503. * @v netdev Network device
  504. * @v iobuf I/O buffer
  505. *
  506. * @ret rc Returns 0 on success, negative on failure
  507. */
  508. static int
  509. e1000_transmit ( struct net_device *netdev, struct io_buffer *iobuf )
  510. {
  511. struct e1000_adapter *adapter = netdev_priv( netdev );
  512. struct e1000_hw *hw = &adapter->hw;
  513. uint32_t tx_curr = adapter->tx_tail;
  514. struct e1000_tx_desc *tx_curr_desc;
  515. DBG ("e1000_transmit\n");
  516. if ( adapter->tx_fill_ctr == NUM_TX_DESC ) {
  517. DBG ("TX overflow\n");
  518. return -ENOBUFS;
  519. }
  520. /* Save pointer to iobuf we have been given to transmit,
  521. netdev_tx_complete() will need it later
  522. */
  523. adapter->tx_iobuf[tx_curr] = iobuf;
  524. tx_curr_desc = ( void * ) ( adapter->tx_base ) +
  525. ( tx_curr * sizeof ( *adapter->tx_base ) );
  526. DBG ( "tx_curr_desc = %#08lx\n", virt_to_bus ( tx_curr_desc ) );
  527. DBG ( "tx_curr_desc + 16 = %#08lx\n", virt_to_bus ( tx_curr_desc ) + 16 );
  528. DBG ( "iobuf->data = %#08lx\n", virt_to_bus ( iobuf->data ) );
  529. /* Add the packet to TX ring
  530. */
  531. tx_curr_desc->buffer_addr =
  532. virt_to_bus ( iobuf->data );
  533. tx_curr_desc->lower.data =
  534. E1000_TXD_CMD_RPS | E1000_TXD_CMD_EOP |
  535. E1000_TXD_CMD_IFCS | iob_len ( iobuf );
  536. tx_curr_desc->upper.data = 0;
  537. DBG ( "TX fill: %d tx_curr: %d addr: %#08lx len: %zd\n", adapter->tx_fill_ctr,
  538. tx_curr, virt_to_bus ( iobuf->data ), iob_len ( iobuf ) );
  539. /* Point to next free descriptor */
  540. adapter->tx_tail = ( adapter->tx_tail + 1 ) % NUM_TX_DESC;
  541. adapter->tx_fill_ctr++;
  542. /* Write new tail to NIC, making packet available for transmit
  543. */
  544. wmb();
  545. E1000_WRITE_REG ( hw, TDT, adapter->tx_tail );
  546. return 0;
  547. }
  548. /**
  549. * e1000_poll - Poll for received packets
  550. *
  551. * @v netdev Network device
  552. */
  553. static void
  554. e1000_poll ( struct net_device *netdev )
  555. {
  556. struct e1000_adapter *adapter = netdev_priv( netdev );
  557. struct e1000_hw *hw = &adapter->hw;
  558. uint32_t icr;
  559. uint32_t tx_status;
  560. uint32_t rx_status;
  561. uint32_t rx_len;
  562. uint32_t rx_err;
  563. struct io_buffer *rx_iob;
  564. struct e1000_tx_desc *tx_curr_desc;
  565. struct e1000_rx_desc *rx_curr_desc;
  566. uint32_t i;
  567. uint64_t tmp_buffer_addr;
  568. DBGP ( "e1000_poll\n" );
  569. /* Acknowledge interrupts */
  570. icr = E1000_READ_REG ( hw, ICR );
  571. if ( ! icr )
  572. return;
  573. DBG ( "e1000_poll: intr_status = %#08x\n", icr );
  574. /* Check status of transmitted packets
  575. */
  576. while ( ( i = adapter->tx_head ) != adapter->tx_tail ) {
  577. tx_curr_desc = ( void * ) ( adapter->tx_base ) +
  578. ( i * sizeof ( *adapter->tx_base ) );
  579. tx_status = tx_curr_desc->upper.data;
  580. /* if the packet at tx_head is not owned by hardware it is for us */
  581. if ( ! ( tx_status & E1000_TXD_STAT_DD ) )
  582. break;
  583. DBG ( "Sent packet. tx_head: %d tx_tail: %d tx_status: %#08x\n",
  584. adapter->tx_head, adapter->tx_tail, tx_status );
  585. if ( tx_status & ( E1000_TXD_STAT_EC | E1000_TXD_STAT_LC |
  586. E1000_TXD_STAT_TU ) ) {
  587. netdev_tx_complete_err ( netdev, adapter->tx_iobuf[i], -EINVAL );
  588. DBG ( "Error transmitting packet, tx_status: %#08x\n",
  589. tx_status );
  590. } else {
  591. netdev_tx_complete ( netdev, adapter->tx_iobuf[i] );
  592. DBG ( "Success transmitting packet, tx_status: %#08x\n",
  593. tx_status );
  594. }
  595. /* Decrement count of used descriptors, clear this descriptor
  596. */
  597. adapter->tx_fill_ctr--;
  598. memset ( tx_curr_desc, 0, sizeof ( *tx_curr_desc ) );
  599. adapter->tx_head = ( adapter->tx_head + 1 ) % NUM_TX_DESC;
  600. }
  601. /* Process received packets
  602. */
  603. while ( 1 ) {
  604. i = adapter->rx_curr;
  605. rx_curr_desc = ( void * ) ( adapter->rx_base ) +
  606. ( i * sizeof ( *adapter->rx_base ) );
  607. rx_status = rx_curr_desc->status;
  608. DBG2 ( "Before DD Check RX_status: %#08x\n", rx_status );
  609. if ( ! ( rx_status & E1000_RXD_STAT_DD ) )
  610. break;
  611. DBG ( "RCTL = %#08x\n", E1000_READ_REG ( &adapter->hw, RCTL ) );
  612. rx_len = rx_curr_desc->length;
  613. DBG ( "Received packet, rx_curr: %d rx_status: %#08x rx_len: %d\n",
  614. i, rx_status, rx_len );
  615. rx_err = rx_curr_desc->errors;
  616. if ( rx_err & E1000_RXD_ERR_FRAME_ERR_MASK ) {
  617. netdev_rx_err ( netdev, NULL, -EINVAL );
  618. DBG ( "e1000_poll: Corrupted packet received!"
  619. " rx_err: %#08x\n", rx_err );
  620. } else {
  621. /* If unable allocate space for this packet,
  622. * try again next poll
  623. */
  624. rx_iob = alloc_iob ( rx_len );
  625. if ( ! rx_iob )
  626. break;
  627. memcpy ( iob_put ( rx_iob, rx_len ),
  628. adapter->rx_iobuf[i]->data, rx_len );
  629. /* Add this packet to the receive queue.
  630. */
  631. netdev_rx ( netdev, rx_iob );
  632. }
  633. tmp_buffer_addr = rx_curr_desc->buffer_addr;
  634. memset ( rx_curr_desc, 0, sizeof ( *rx_curr_desc ) );
  635. rx_curr_desc->buffer_addr = tmp_buffer_addr;
  636. E1000_WRITE_REG ( hw, RDT, adapter->rx_curr );
  637. adapter->rx_curr = ( adapter->rx_curr + 1 ) % NUM_RX_DESC;
  638. }
  639. }
  640. /**
  641. * e1000_irq - enable or Disable interrupts
  642. *
  643. * @v adapter e1000 adapter
  644. * @v action requested interrupt action
  645. **/
  646. static void
  647. e1000_irq ( struct net_device *netdev, int enable )
  648. {
  649. struct e1000_adapter *adapter = netdev_priv(netdev);
  650. DBG ( "e1000_irq\n" );
  651. switch ( enable ) {
  652. case 0 :
  653. e1000_irq_disable ( adapter );
  654. break;
  655. case 1 :
  656. e1000_irq_enable ( adapter );
  657. break;
  658. case 2 :
  659. e1000_irq_force ( adapter );
  660. break;
  661. }
  662. }
  663. static struct net_device_operations e1000_operations;
  664. /**
  665. * e1000_probe - Initial configuration of e1000 NIC
  666. *
  667. * @v pci PCI device
  668. * @v id PCI IDs
  669. *
  670. * @ret rc Return status code
  671. **/
  672. static int
  673. e1000_probe ( struct pci_device *pdev,
  674. const struct pci_device_id *id __unused )
  675. {
  676. int i, err;
  677. struct net_device *netdev;
  678. struct e1000_adapter *adapter;
  679. unsigned long mmio_start, mmio_len;
  680. unsigned long flash_start, flash_len;
  681. DBG ( "e1000_probe\n" );
  682. err = -ENOMEM;
  683. /* Allocate net device ( also allocates memory for netdev->priv
  684. and makes netdev-priv point to it ) */
  685. netdev = alloc_etherdev ( sizeof ( struct e1000_adapter ) );
  686. if ( ! netdev )
  687. goto err_alloc_etherdev;
  688. /* Associate e1000-specific network operations operations with
  689. * generic network device layer */
  690. netdev_init ( netdev, &e1000_operations );
  691. /* Associate this network device with given PCI device */
  692. pci_set_drvdata ( pdev, netdev );
  693. netdev->dev = &pdev->dev;
  694. /* Initialize driver private storage */
  695. adapter = netdev_priv ( netdev );
  696. memset ( adapter, 0, ( sizeof ( *adapter ) ) );
  697. adapter->hw.io_base = pdev->ioaddr;
  698. adapter->ioaddr = pdev->ioaddr;
  699. adapter->irqno = pdev->irq;
  700. adapter->netdev = netdev;
  701. adapter->pdev = pdev;
  702. adapter->hw.back = adapter;
  703. adapter->tx_ring_size = sizeof ( *adapter->tx_base ) * NUM_TX_DESC;
  704. adapter->rx_ring_size = sizeof ( *adapter->rx_base ) * NUM_RX_DESC;
  705. mmio_start = pci_bar_start ( pdev, PCI_BASE_ADDRESS_0 );
  706. mmio_len = pci_bar_size ( pdev, PCI_BASE_ADDRESS_0 );
  707. DBG ( "mmio_start: %#08lx\n", mmio_start );
  708. DBG ( "mmio_len: %#08lx\n", mmio_len );
  709. /* Fix up PCI device */
  710. adjust_pci_device ( pdev );
  711. err = -EIO;
  712. adapter->hw.hw_addr = ioremap ( mmio_start, mmio_len );
  713. DBG ( "adapter->hw.hw_addr: %p\n", adapter->hw.hw_addr );
  714. if ( ! adapter->hw.hw_addr )
  715. goto err_ioremap;
  716. /* setup the private structure */
  717. if ( ( err = e1000_sw_init ( adapter ) ) )
  718. goto err_sw_init;
  719. DBG ( "adapter->hw.mac_type: %#08x\n", adapter->hw.mac_type );
  720. /* Flash BAR mapping must happen after e1000_sw_init
  721. * because it depends on mac_type
  722. */
  723. if ( ( adapter->hw.mac_type == e1000_ich8lan ) && ( pdev->ioaddr ) ) {
  724. flash_start = pci_bar_start ( pdev, PCI_BASE_ADDRESS_1 );
  725. flash_len = pci_bar_size ( pdev, PCI_BASE_ADDRESS_1 );
  726. adapter->hw.flash_address = ioremap ( flash_start, flash_len );
  727. if ( ! adapter->hw.flash_address )
  728. goto err_flashmap;
  729. }
  730. /* initialize eeprom parameters */
  731. if ( e1000_init_eeprom_params ( &adapter->hw ) ) {
  732. DBG ( "EEPROM initialization failed\n" );
  733. goto err_eeprom;
  734. }
  735. /* before reading the EEPROM, reset the controller to
  736. * put the device in a known good starting state
  737. */
  738. err = e1000_reset_hw ( &adapter->hw );
  739. if ( err < 0 ) {
  740. DBG ( "Hardware Initialization Failed\n" );
  741. goto err_reset;
  742. }
  743. /* make sure the EEPROM is good */
  744. if ( e1000_validate_eeprom_checksum( &adapter->hw ) < 0 ) {
  745. DBG ( "The EEPROM Checksum Is Not Valid\n" );
  746. goto err_eeprom;
  747. }
  748. /* copy the MAC address out of the EEPROM */
  749. if ( e1000_read_mac_addr ( &adapter->hw ) )
  750. DBG ( "EEPROM Read Error\n" );
  751. memcpy ( netdev->hw_addr, adapter->hw.mac_addr, ETH_ALEN );
  752. /* print bus type/speed/width info */
  753. {
  754. struct e1000_hw *hw = &adapter->hw;
  755. DBG ( "(PCI%s:%s:%s) ",
  756. ((hw->bus_type == e1000_bus_type_pcix) ? "-X" :
  757. (hw->bus_type == e1000_bus_type_pci_express ? " Express":"")),
  758. ((hw->bus_speed == e1000_bus_speed_2500) ? "2.5Gb/s" :
  759. (hw->bus_speed == e1000_bus_speed_133) ? "133MHz" :
  760. (hw->bus_speed == e1000_bus_speed_120) ? "120MHz" :
  761. (hw->bus_speed == e1000_bus_speed_100) ? "100MHz" :
  762. (hw->bus_speed == e1000_bus_speed_66) ? "66MHz" : "33MHz"),
  763. ((hw->bus_width == e1000_bus_width_64) ? "64-bit" :
  764. (hw->bus_width == e1000_bus_width_pciex_4) ? "Width x4" :
  765. (hw->bus_width == e1000_bus_width_pciex_1) ? "Width x1" :
  766. "32-bit"));
  767. }
  768. for (i = 0; i < 6; i++)
  769. DBG ("%02x%s", netdev->ll_addr[i], i == 5 ? "\n" : ":");
  770. /* reset the hardware with the new settings */
  771. e1000_reset ( adapter );
  772. e1000_get_hw_control ( adapter );
  773. /* Mark as link up; we don't yet handle link state */
  774. netdev_link_up ( netdev );
  775. if ( ( err = register_netdev ( netdev ) ) != 0)
  776. goto err_register;
  777. DBG ( "e1000_probe succeeded!\n" );
  778. /* No errors, return success */
  779. return 0;
  780. /* Error return paths */
  781. err_reset:
  782. err_register:
  783. err_eeprom:
  784. if ( ! e1000_check_phy_reset_block ( &adapter->hw ) )
  785. e1000_phy_hw_reset ( &adapter->hw );
  786. if ( adapter->hw.flash_address )
  787. iounmap ( adapter->hw.flash_address );
  788. err_flashmap:
  789. err_sw_init:
  790. iounmap ( adapter->hw.hw_addr );
  791. err_ioremap:
  792. netdev_put ( netdev );
  793. err_alloc_etherdev:
  794. return err;
  795. }
  796. /**
  797. * e1000_remove - Device Removal Routine
  798. *
  799. * @v pdev PCI device information struct
  800. *
  801. **/
  802. static void
  803. e1000_remove ( struct pci_device *pdev )
  804. {
  805. struct net_device *netdev = pci_get_drvdata ( pdev );
  806. struct e1000_adapter *adapter = netdev_priv ( netdev );
  807. DBG ( "e1000_remove\n" );
  808. if ( adapter->hw.flash_address )
  809. iounmap ( adapter->hw.flash_address );
  810. if ( adapter->hw.hw_addr )
  811. iounmap ( adapter->hw.hw_addr );
  812. unregister_netdev ( netdev );
  813. e1000_reset_hw ( &adapter->hw );
  814. netdev_nullify ( netdev );
  815. netdev_put ( netdev );
  816. }
  817. /**
  818. * e1000_open - Called when a network interface is made active
  819. *
  820. * @v netdev network interface device structure
  821. * @ret rc Return status code, 0 on success, negative value on failure
  822. *
  823. **/
  824. static int
  825. e1000_open ( struct net_device *netdev )
  826. {
  827. struct e1000_adapter *adapter = netdev_priv(netdev);
  828. int err;
  829. DBG ( "e1000_open\n" );
  830. /* allocate transmit descriptors */
  831. err = e1000_setup_tx_resources ( adapter );
  832. if ( err ) {
  833. DBG ( "Error setting up TX resources!\n" );
  834. goto err_setup_tx;
  835. }
  836. /* allocate receive descriptors */
  837. err = e1000_setup_rx_resources ( adapter );
  838. if ( err ) {
  839. DBG ( "Error setting up RX resources!\n" );
  840. goto err_setup_rx;
  841. }
  842. e1000_configure_tx ( adapter );
  843. e1000_configure_rx ( adapter );
  844. DBG ( "RXDCTL: %#08x\n", E1000_READ_REG ( &adapter->hw, RXDCTL ) );
  845. return 0;
  846. err_setup_rx:
  847. e1000_free_tx_resources ( adapter );
  848. err_setup_tx:
  849. e1000_reset ( adapter );
  850. return err;
  851. }
  852. /** e1000 net device operations */
  853. static struct net_device_operations e1000_operations = {
  854. .open = e1000_open,
  855. .close = e1000_close,
  856. .transmit = e1000_transmit,
  857. .poll = e1000_poll,
  858. .irq = e1000_irq,
  859. };
  860. int32_t
  861. e1000_read_pcie_cap_reg(struct e1000_hw *hw, uint32_t reg, uint16_t *value)
  862. {
  863. struct e1000_adapter *adapter = hw->back;
  864. uint16_t cap_offset;
  865. #define PCI_CAP_ID_EXP 0x10 /* PCI Express */
  866. cap_offset = pci_find_capability(adapter->pdev, PCI_CAP_ID_EXP);
  867. if (!cap_offset)
  868. return -E1000_ERR_CONFIG;
  869. pci_read_config_word(adapter->pdev, cap_offset + reg, value);
  870. return 0;
  871. }
  872. void
  873. e1000_pci_clear_mwi ( struct e1000_hw *hw )
  874. {
  875. struct e1000_adapter *adapter = hw->back;
  876. pci_write_config_word ( adapter->pdev, PCI_COMMAND,
  877. hw->pci_cmd_word & ~PCI_COMMAND_INVALIDATE );
  878. }
  879. void
  880. e1000_pci_set_mwi ( struct e1000_hw *hw )
  881. {
  882. struct e1000_adapter *adapter = hw->back;
  883. pci_write_config_word ( adapter->pdev, PCI_COMMAND, hw->pci_cmd_word );
  884. }
  885. void
  886. e1000_read_pci_cfg ( struct e1000_hw *hw, uint32_t reg, uint16_t *value )
  887. {
  888. struct e1000_adapter *adapter = hw->back;
  889. pci_read_config_word ( adapter->pdev, reg, value );
  890. }
  891. void
  892. e1000_write_pci_cfg ( struct e1000_hw *hw, uint32_t reg, uint16_t *value )
  893. {
  894. struct e1000_adapter *adapter = hw->back;
  895. pci_write_config_word ( adapter->pdev, reg, *value );
  896. }
  897. void
  898. e1000_io_write ( struct e1000_hw *hw __unused, unsigned long port, uint32_t value )
  899. {
  900. outl ( value, port );
  901. }
  902. static struct pci_device_id e1000_nics[] = {
  903. PCI_ROM(0x8086, 0x1000, "e1000-0x1000", "e1000-0x1000", 0),
  904. PCI_ROM(0x8086, 0x1001, "e1000-0x1001", "e1000-0x1001", 0),
  905. PCI_ROM(0x8086, 0x1004, "e1000-0x1004", "e1000-0x1004", 0),
  906. PCI_ROM(0x8086, 0x1008, "e1000-0x1008", "e1000-0x1008", 0),
  907. PCI_ROM(0x8086, 0x1009, "e1000-0x1009", "e1000-0x1009", 0),
  908. PCI_ROM(0x8086, 0x100c, "e1000-0x100c", "e1000-0x100c", 0),
  909. PCI_ROM(0x8086, 0x100d, "e1000-0x100d", "e1000-0x100d", 0),
  910. PCI_ROM(0x8086, 0x100e, "e1000-0x100e", "e1000-0x100e", 0),
  911. PCI_ROM(0x8086, 0x100f, "e1000-0x100f", "e1000-0x100f", 0),
  912. PCI_ROM(0x8086, 0x1010, "e1000-0x1010", "e1000-0x1010", 0),
  913. PCI_ROM(0x8086, 0x1011, "e1000-0x1011", "e1000-0x1011", 0),
  914. PCI_ROM(0x8086, 0x1012, "e1000-0x1012", "e1000-0x1012", 0),
  915. PCI_ROM(0x8086, 0x1013, "e1000-0x1013", "e1000-0x1013", 0),
  916. PCI_ROM(0x8086, 0x1014, "e1000-0x1014", "e1000-0x1014", 0),
  917. PCI_ROM(0x8086, 0x1015, "e1000-0x1015", "e1000-0x1015", 0),
  918. PCI_ROM(0x8086, 0x1016, "e1000-0x1016", "e1000-0x1016", 0),
  919. PCI_ROM(0x8086, 0x1017, "e1000-0x1017", "e1000-0x1017", 0),
  920. PCI_ROM(0x8086, 0x1018, "e1000-0x1018", "e1000-0x1018", 0),
  921. PCI_ROM(0x8086, 0x1019, "e1000-0x1019", "e1000-0x1019", 0),
  922. PCI_ROM(0x8086, 0x101a, "e1000-0x101a", "e1000-0x101a", 0),
  923. PCI_ROM(0x8086, 0x101d, "e1000-0x101d", "e1000-0x101d", 0),
  924. PCI_ROM(0x8086, 0x101e, "e1000-0x101e", "e1000-0x101e", 0),
  925. PCI_ROM(0x8086, 0x1026, "e1000-0x1026", "e1000-0x1026", 0),
  926. PCI_ROM(0x8086, 0x1027, "e1000-0x1027", "e1000-0x1027", 0),
  927. PCI_ROM(0x8086, 0x1028, "e1000-0x1028", "e1000-0x1028", 0),
  928. PCI_ROM(0x8086, 0x1049, "e1000-0x1049", "e1000-0x1049", 0),
  929. PCI_ROM(0x8086, 0x104a, "e1000-0x104a", "e1000-0x104a", 0),
  930. PCI_ROM(0x8086, 0x104b, "e1000-0x104b", "e1000-0x104b", 0),
  931. PCI_ROM(0x8086, 0x104c, "e1000-0x104c", "e1000-0x104c", 0),
  932. PCI_ROM(0x8086, 0x104d, "e1000-0x104d", "e1000-0x104d", 0),
  933. PCI_ROM(0x8086, 0x105e, "e1000-0x105e", "e1000-0x105e", 0),
  934. PCI_ROM(0x8086, 0x105f, "e1000-0x105f", "e1000-0x105f", 0),
  935. PCI_ROM(0x8086, 0x1060, "e1000-0x1060", "e1000-0x1060", 0),
  936. PCI_ROM(0x8086, 0x1075, "e1000-0x1075", "e1000-0x1075", 0),
  937. PCI_ROM(0x8086, 0x1076, "e1000-0x1076", "e1000-0x1076", 0),
  938. PCI_ROM(0x8086, 0x1077, "e1000-0x1077", "e1000-0x1077", 0),
  939. PCI_ROM(0x8086, 0x1078, "e1000-0x1078", "e1000-0x1078", 0),
  940. PCI_ROM(0x8086, 0x1079, "e1000-0x1079", "e1000-0x1079", 0),
  941. PCI_ROM(0x8086, 0x107a, "e1000-0x107a", "e1000-0x107a", 0),
  942. PCI_ROM(0x8086, 0x107b, "e1000-0x107b", "e1000-0x107b", 0),
  943. PCI_ROM(0x8086, 0x107c, "e1000-0x107c", "e1000-0x107c", 0),
  944. PCI_ROM(0x8086, 0x107d, "e1000-0x107d", "e1000-0x107d", 0),
  945. PCI_ROM(0x8086, 0x107e, "e1000-0x107e", "e1000-0x107e", 0),
  946. PCI_ROM(0x8086, 0x107f, "e1000-0x107f", "e1000-0x107f", 0),
  947. PCI_ROM(0x8086, 0x108a, "e1000-0x108a", "e1000-0x108a", 0),
  948. PCI_ROM(0x8086, 0x108b, "e1000-0x108b", "e1000-0x108b", 0),
  949. PCI_ROM(0x8086, 0x108c, "e1000-0x108c", "e1000-0x108c", 0),
  950. PCI_ROM(0x8086, 0x1096, "e1000-0x1096", "e1000-0x1096", 0),
  951. PCI_ROM(0x8086, 0x1098, "e1000-0x1098", "e1000-0x1098", 0),
  952. PCI_ROM(0x8086, 0x1099, "e1000-0x1099", "e1000-0x1099", 0),
  953. PCI_ROM(0x8086, 0x109a, "e1000-0x109a", "e1000-0x109a", 0),
  954. PCI_ROM(0x8086, 0x10a4, "e1000-0x10a4", "e1000-0x10a4", 0),
  955. PCI_ROM(0x8086, 0x10a5, "e1000-0x10a5", "e1000-0x10a5", 0),
  956. PCI_ROM(0x8086, 0x10b5, "e1000-0x10b5", "e1000-0x10b5", 0),
  957. PCI_ROM(0x8086, 0x10b9, "e1000-0x10b9", "e1000-0x10b9", 0),
  958. PCI_ROM(0x8086, 0x10ba, "e1000-0x10ba", "e1000-0x10ba", 0),
  959. PCI_ROM(0x8086, 0x10bb, "e1000-0x10bb", "e1000-0x10bb", 0),
  960. PCI_ROM(0x8086, 0x10bc, "e1000-0x10bc", "e1000-0x10bc", 0),
  961. PCI_ROM(0x8086, 0x10c4, "e1000-0x10c4", "e1000-0x10c4", 0),
  962. PCI_ROM(0x8086, 0x10c5, "e1000-0x10c5", "e1000-0x10c5", 0),
  963. PCI_ROM(0x8086, 0x10c9, "e1000-0x10c9", "e1000-0x10c9", 0),
  964. PCI_ROM(0x8086, 0x10d9, "e1000-0x10d9", "e1000-0x10d9", 0),
  965. PCI_ROM(0x8086, 0x10da, "e1000-0x10da", "e1000-0x10da", 0),
  966. };
  967. struct pci_driver e1000_driver __pci_driver = {
  968. .ids = e1000_nics,
  969. .id_count = (sizeof (e1000_nics) / sizeof (e1000_nics[0])),
  970. .probe = e1000_probe,
  971. .remove = e1000_remove,
  972. };
  973. /*
  974. * Local variables:
  975. * c-basic-offset: 8
  976. * c-indent-level: 8
  977. * tab-width: 8
  978. * End:
  979. */