|
@@ -1937,6 +1937,32 @@ static void phantom_get_macaddr ( struct phantom_nic *phantom,
|
1937
|
1937
|
phantom, eth_ntoa ( ll_addr ) );
|
1938
|
1938
|
}
|
1939
|
1939
|
|
|
1940
|
+/**
|
|
1941
|
+ * Check Phantom is enabled for boot
|
|
1942
|
+ *
|
|
1943
|
+ * @v phanton_port Phantom NIC
|
|
1944
|
+ * @ret rc Return status code
|
|
1945
|
+ *
|
|
1946
|
+ * This is something of an ugly hack to accommodate an OEM
|
|
1947
|
+ * requirement. The NIC has only one expansion ROM BAR, rather than
|
|
1948
|
+ * one per port. To allow individual ports to be selectively
|
|
1949
|
+ * enabled/disabled for PXE boot (as required), we must therefore
|
|
1950
|
+ * leave the expansion ROM always enabled, and place the per-port
|
|
1951
|
+ * enable/disable logic within the gPXE driver.
|
|
1952
|
+ */
|
|
1953
|
+static int phantom_check_boot_enable ( struct phantom_nic *phantom ) {
|
|
1954
|
+ unsigned long boot_enable;
|
|
1955
|
+
|
|
1956
|
+ boot_enable = phantom_readl ( phantom, UNM_CAM_RAM_BOOT_ENABLE );
|
|
1957
|
+ if ( ! ( boot_enable & ( 1 << phantom->port ) ) ) {
|
|
1958
|
+ DBGC ( phantom, "Phantom %p PXE boot is disabled\n",
|
|
1959
|
+ phantom );
|
|
1960
|
+ return -ENOTSUP;
|
|
1961
|
+ }
|
|
1962
|
+
|
|
1963
|
+ return 0;
|
|
1964
|
+}
|
|
1965
|
+
|
1940
|
1966
|
/**
|
1941
|
1967
|
* Initialise Phantom receive PEG
|
1942
|
1968
|
*
|
|
@@ -2034,6 +2060,10 @@ static int phantom_probe ( struct pci_device *pci,
|
2034
|
2060
|
/* Read MAC addresses */
|
2035
|
2061
|
phantom_get_macaddr ( phantom, netdev->ll_addr );
|
2036
|
2062
|
|
|
2063
|
+ /* Skip if boot disabled on NIC */
|
|
2064
|
+ if ( ( rc = phantom_check_boot_enable ( phantom ) ) != 0 )
|
|
2065
|
+ goto err_check_boot_enable;
|
|
2066
|
+
|
2037
|
2067
|
/* Register network devices */
|
2038
|
2068
|
if ( ( rc = register_netdev ( netdev ) ) != 0 ) {
|
2039
|
2069
|
DBGC ( phantom, "Phantom %p could not register net device: "
|
|
@@ -2056,6 +2086,7 @@ static int phantom_probe ( struct pci_device *pci,
|
2056
|
2086
|
err_register_settings:
|
2057
|
2087
|
unregister_netdev ( netdev );
|
2058
|
2088
|
err_register_netdev:
|
|
2089
|
+ err_check_boot_enable:
|
2059
|
2090
|
err_init_rcvpeg:
|
2060
|
2091
|
err_init_cmdpeg:
|
2061
|
2092
|
phantom_halt_pegs ( phantom );
|