Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
soc:2008:mdeck:notes:gpxe_driver_api [2008/05/30 04:57]
mdeck
soc:2008:mdeck:notes:gpxe_driver_api [2009/11/03 08:58] (current)
meteger
Line 8: Line 8:
 Existing Etherboot PCI drivers are temporarily supported via the compatibility layer in src/​drivers/​net/​legacy.c Existing Etherboot PCI drivers are temporarily supported via the compatibility layer in src/​drivers/​net/​legacy.c
 Drivers currently conforming to the gPXE Network Driver API are: Drivers currently conforming to the gPXE Network Driver API are:
 +  * 3c90x
 +  * ath5k
 +  * atl1e
 +  * b44
   * e1000   * e1000
 +  * etherfabric
 +  * mtnic
   * natsemi   * natsemi
 +  * phantom
 +  * pnic
 +  * r8169
   * rtl8139   * rtl8139
 +  * rtl818x 
 +  * sis190 
 +  * sky2
  
  
Line 40: Line 51:
   - Initialize [[#​EEPROM|EEPROM]].   - Initialize [[#​EEPROM|EEPROM]].
   - Read the MAC address from EEPROM.   - Read the MAC address from EEPROM.
-  - Mark the ''​net_device''​ as having a link up with ''​netdev_link_up()''​, as we don't yet handle the link state.+  - Check the link state and report ​''​netdev_link_up()'' ​if connected. ​ Many drivers ​don't yet handle the link state and simply assume the link is up.
   - Name the device and add it to the list of network devices via ''​register_netdev()''​.   - Name the device and add it to the list of network devices via ''​register_netdev()''​.
   - Possibly setup a non-volatile stored options block with ''​nvo_init()''​ & ''​register_nvo()''​.   - Possibly setup a non-volatile stored options block with ''​nvo_init()''​ & ''​register_nvo()''​.
Line 77: Line 88:
 ==== close ==== ==== close ====
 ''​static void close ( struct net_device* )''​\\ ''​static void close ( struct net_device* )''​\\
-This function is called ​repeatedly ​in ''​autoboot()''​ during [[:​soc:​2008:​mdeck:​notes:​initialization|initialization]], ​prior to attempting ​to boot each network device. ​ In this routine, a typical driver might:+This function is called ​if the device is open in ''​autoboot()''​ during [[:​soc:​2008:​mdeck:​notes:​initialization|initialization]], ​after a failed or successful attempt ​to boot the network device. ​ In this routine, a typical driver might:
   - Acknowledge interrupts.   - Acknowledge interrupts.
   - Disable irq, receives.   - Disable irq, receives.
Line 85: Line 96:
 ==== open ==== ==== open ====
 ''​static int open ( struct net_device* )''​\\ ''​static int open ( struct net_device* )''​\\
-This function is first called in ''​netboot()''​ when attempting a device boot during [[:​soc:​2008:​mdeck:​notes:​initialization|initialization]], ​//after// ''​close()''​ is called. ​ A driver would:+This function is first called in ''​netboot()''​ when attempting a device boot during [[:​soc:​2008:​mdeck:​notes:​initialization|initialization]],​ after ''​close()'' ​of any previous device attempt ​is called. ​ A driver would:
   - Program MAC address to device.   - Program MAC address to device.
   - Setup TX & RX rings.   - Setup TX & RX rings.
Line 104: Line 115:
 This function is called periodically by the network stack to process tx completions and rx packets. ​ A typical driver would: This function is called periodically by the network stack to process tx completions and rx packets. ​ A typical driver would:
   - Acknowledge interrupts.   - Acknowledge interrupts.
-  - Feed tx completions to ''​netdev_tx_complete()''​ or ''​netdev_tx_complete_err()''​. +  - Check hardware and feed tx completions to ''​netdev_tx_complete()''​ or ''​netdev_tx_complete_err()''​. 
-  - Add good received packets to receive queue with ''​netdev_rx()'',​ or feed corrupted packets to ''​netdev_rx_err()''​+  - Add good received packets to receive queue with ''​netdev_rx()'',​ or report ​corrupted packets to ''​netdev_rx_err()''​ 
 +  - Check link state occasionally,​ and report changes with ''​netdev_link_up()''​ or ''​netdev_link_down()''​
  
 ==== irq ==== ==== irq ====

QR Code
QR Code soc:2008:mdeck:notes:gpxe_driver_api (generated for current page)