Преглед на файлове

[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.
tags/v0.9.4
Michael Brown преди 15 години
родител
ревизия
4011f9d956
променени са 1 файла, в които са добавени 11 реда и са изтрити 0 реда
  1. 11
    0
      src/drivers/net/phantom/phantom.c

+ 11
- 0
src/drivers/net/phantom/phantom.c Целия файл

@@ -1673,6 +1673,17 @@ static int phantom_init_cmdpeg ( struct phantom_nic *phantom ) {
1673 1673
 	uint32_t cmdpeg_state;
1674 1674
 	uint32_t last_cmdpeg_state = 0;
1675 1675
 
1676
+	/* Check for a previous initialisation.  This could have
1677
+	 * happened if, for example, the BIOS used the UNDI API to
1678
+	 * drive the NIC prior to a full PXE boot.
1679
+	 */
1680
+	cmdpeg_state = phantom_readl ( phantom, UNM_NIC_REG_CMDPEG_STATE );
1681
+	if ( cmdpeg_state == UNM_NIC_REG_CMDPEG_STATE_INITIALIZE_ACK ) {
1682
+		DBGC ( phantom, "Phantom %p command PEG already initialized\n",
1683
+		       phantom );
1684
+		return 0;
1685
+	}
1686
+
1676 1687
 	/* If this was a cold boot, check that the hardware came up ok */
1677 1688
 	cold_boot = phantom_readl ( phantom, UNM_CAM_RAM_COLD_BOOT );
1678 1689
 	if ( cold_boot == UNM_CAM_RAM_COLD_BOOT_MAGIC ) {

Loading…
Отказ
Запис