Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[phantom] Skip command PEG initialisation if PEG is already running
It is possible for the BIOS to use the UNDI API to bring up the NIC
prior to system boot.  If this happens, UNM_NIC_REG_CMDPEG_STATE will
contain the value 0xf00f (UNM_NIC_REG_CMDPEG_STATE_INITIALIZE_ACK),
and we should skip initialising the command PEG.
  • Loading branch information
Michael Brown committed Sep 23, 2008
1 parent 8b20e5d commit 4011f9d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/drivers/net/phantom/phantom.c
Expand Up @@ -1673,6 +1673,17 @@ static int phantom_init_cmdpeg ( struct phantom_nic *phantom ) {
uint32_t cmdpeg_state;
uint32_t last_cmdpeg_state = 0;

/* Check for a previous initialisation. This could have
* happened if, for example, the BIOS used the UNDI API to
* drive the NIC prior to a full PXE boot.
*/
cmdpeg_state = phantom_readl ( phantom, UNM_NIC_REG_CMDPEG_STATE );
if ( cmdpeg_state == UNM_NIC_REG_CMDPEG_STATE_INITIALIZE_ACK ) {
DBGC ( phantom, "Phantom %p command PEG already initialized\n",
phantom );
return 0;
}

/* If this was a cold boot, check that the hardware came up ok */
cold_boot = phantom_readl ( phantom, UNM_CAM_RAM_COLD_BOOT );
if ( cold_boot == UNM_CAM_RAM_COLD_BOOT_MAGIC ) {
Expand Down

0 comments on commit 4011f9d

Please sign in to comment.