summaryrefslogtreecommitdiffstats
path: root/src/include
diff options
context:
space:
mode:
authorMichael Brown2009-07-17 23:48:31 +0200
committerMichael Brown2009-07-18 00:02:48 +0200
commitd09290161e33574d8f0fa900ebe739214d17fe1a (patch)
tree9cb59387262344ed50fc755362154206017ab220 /src/include
parent[ata] Make ATA command issuing partially asynchronous (diff)
downloadipxe-d09290161e33574d8f0fa900ebe739214d17fe1a.tar.gz
ipxe-d09290161e33574d8f0fa900ebe739214d17fe1a.tar.xz
ipxe-d09290161e33574d8f0fa900ebe739214d17fe1a.zip
[netdevice] Make ll_broadcast per-netdevice rather than per-ll_protocol
IPoIB has a link-layer broadcast address that varies according to the partition key. We currently go through several contortions to pretend that the link-layer address is a fixed constant; by making the broadcast address a property of the network device rather than the link-layer protocol it will be possible to simplify IPoIB's broadcast handling.
Diffstat (limited to 'src/include')
-rw-r--r--src/include/gpxe/ethernet.h22
-rw-r--r--src/include/gpxe/ipoib.h21
-rw-r--r--src/include/gpxe/netdevice.h4
3 files changed, 4 insertions, 43 deletions
diff --git a/src/include/gpxe/ethernet.h b/src/include/gpxe/ethernet.h
index 45ab9a092..9bd3455c5 100644
--- a/src/include/gpxe/ethernet.h
+++ b/src/include/gpxe/ethernet.h
@@ -10,28 +10,8 @@
FILE_LICENCE ( GPL2_OR_LATER );
#include <stdint.h>
-#include <gpxe/netdevice.h>
-#include <gpxe/if_ether.h>
-
-extern struct ll_protocol ethernet_protocol;
extern const char * eth_ntoa ( const void *ll_addr );
-
-/**
- * Allocate Ethernet device
- *
- * @v priv_size Size of driver private data
- * @ret netdev Network device, or NULL
- */
-static inline struct net_device * alloc_etherdev ( size_t priv_size ) {
- struct net_device *netdev;
-
- netdev = alloc_netdev ( priv_size );
- if ( netdev ) {
- netdev->ll_protocol = &ethernet_protocol;
- netdev->max_pkt_len = ETH_FRAME_LEN;
- }
- return netdev;
-}
+extern struct net_device * alloc_etherdev ( size_t priv_size );
#endif /* _GPXE_ETHERNET_H */
diff --git a/src/include/gpxe/ipoib.h b/src/include/gpxe/ipoib.h
index 5db238479..79d7b3fbc 100644
--- a/src/include/gpxe/ipoib.h
+++ b/src/include/gpxe/ipoib.h
@@ -54,29 +54,10 @@ struct ipoib_hdr {
} __attribute__ (( packed )) u;
} __attribute__ (( packed ));
-extern struct ll_protocol ipoib_protocol;
-
extern const char * ipoib_ntoa ( const void *ll_addr );
-
-/**
- * Allocate IPoIB device
- *
- * @v priv_size Size of driver private data
- * @ret netdev Network device, or NULL
- */
-static inline struct net_device * alloc_ipoibdev ( size_t priv_size ) {
- struct net_device *netdev;
-
- netdev = alloc_netdev ( priv_size );
- if ( netdev ) {
- netdev->ll_protocol = &ipoib_protocol;
- netdev->max_pkt_len = IPOIB_PKT_LEN;
- }
- return netdev;
-}
-
extern void ipoib_link_state_changed ( struct ib_device *ibdev );
extern int ipoib_probe ( struct ib_device *ibdev );
extern void ipoib_remove ( struct ib_device *ibdev );
+extern struct net_device * alloc_ipoibdev ( size_t priv_size );
#endif /* _GPXE_IPOIB_H */
diff --git a/src/include/gpxe/netdevice.h b/src/include/gpxe/netdevice.h
index 70644af1e..0f191dd68 100644
--- a/src/include/gpxe/netdevice.h
+++ b/src/include/gpxe/netdevice.h
@@ -144,8 +144,6 @@ struct ll_protocol {
uint8_t ll_addr_len;
/** Link-layer header length */
uint8_t ll_header_len;
- /** Link-layer broadcast address */
- const uint8_t *ll_broadcast;
};
/** Network device operations */
@@ -261,6 +259,8 @@ struct net_device {
* For Ethernet, this is the MAC address.
*/
uint8_t ll_addr[MAX_LL_ADDR_LEN];
+ /** Link-layer broadcast address */
+ const uint8_t *ll_broadcast;
/** Current device state
*