Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[802.11] Support multicast hashing
802.11 multicast hashing is the same as standard Ethernet hashing, so
just expose and use eth_mc_hash().

Signed-off-by: Joshua Oreman <oremanj@rwcr.net>
  • Loading branch information
Michael Brown committed Aug 11, 2009
1 parent 2310c30 commit a7290a9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 22 deletions.
2 changes: 2 additions & 0 deletions src/include/gpxe/ethernet.h
Expand Up @@ -13,6 +13,8 @@ FILE_LICENCE ( GPL2_OR_LATER );

extern void eth_init_addr ( const void *hw_addr, void *ll_addr );
extern const char * eth_ntoa ( const void *ll_addr );
extern int eth_mc_hash ( unsigned int af, const void *net_addr,
void *ll_addr );
extern struct net_device * alloc_etherdev ( size_t priv_size );

#endif /* _GPXE_ETHERNET_H */
21 changes: 1 addition & 20 deletions src/net/80211/net80211.c
Expand Up @@ -160,8 +160,6 @@ static int net80211_ll_push ( struct net_device *netdev,
static int net80211_ll_pull ( struct net_device *netdev,
struct io_buffer *iobuf, const void **ll_dest,
const void **ll_source, uint16_t * net_proto );
static int net80211_ll_mc_hash ( unsigned int af, const void *net_addr,
void *ll_addr );
/** @} */

/**
Expand Down Expand Up @@ -580,31 +578,14 @@ static int net80211_ll_pull ( struct net_device *netdev __unused,
return 0;
}

/**
* Hash 802.11 multicast address
*
* @v af Address family
* @v net_addr Network-layer address
* @ret ll_addr Filled link-layer address
* @ret rc Return status code
*
* Currently unimplemented.
*/
static int net80211_ll_mc_hash ( unsigned int af __unused,
const void *net_addr __unused,
void *ll_addr __unused )
{
return -ENOTSUP;
}

/** 802.11 link-layer protocol */
static struct ll_protocol net80211_ll_protocol __ll_protocol = {
.name = "802.11",
.push = net80211_ll_push,
.pull = net80211_ll_pull,
.init_addr = eth_init_addr,
.ntoa = eth_ntoa,
.mc_hash = net80211_ll_mc_hash,
.mc_hash = eth_mc_hash,
.ll_proto = htons ( ARPHRD_ETHER ), /* "encapsulated Ethernet" */
.hw_addr_len = ETH_ALEN,
.ll_addr_len = ETH_ALEN,
Expand Down
3 changes: 1 addition & 2 deletions src/net/ethernet.c
Expand Up @@ -130,8 +130,7 @@ const char * eth_ntoa ( const void *ll_addr ) {
* @v ll_addr Link-layer address to fill in
* @ret rc Return status code
*/
static int eth_mc_hash ( unsigned int af, const void *net_addr,
void *ll_addr ) {
int eth_mc_hash ( unsigned int af, const void *net_addr, void *ll_addr ) {
const uint8_t *net_addr_bytes = net_addr;
uint8_t *ll_addr_bytes = ll_addr;

Expand Down

0 comments on commit a7290a9

Please sign in to comment.