mirror of
https://github.com/ipxe/ipxe
synced 2025-12-28 02:28:57 +03:00
Started IB driver rewrite
This commit is contained in:
52
src/include/gpxe/infiniband.h
Normal file
52
src/include/gpxe/infiniband.h
Normal file
@@ -0,0 +1,52 @@
|
||||
#ifndef _GPXE_INFINIBAND_H
|
||||
#define _GPXE_INFINIBAND_H
|
||||
|
||||
/** @file
|
||||
*
|
||||
* Infiniband protocol
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include <gpxe/netdevice.h>
|
||||
|
||||
/** Infiniband hardware address length */
|
||||
#define IB_ALEN 20
|
||||
#define IB_HLEN 24
|
||||
|
||||
/** An Infiniband header
|
||||
*
|
||||
* This data structure doesn't represent the on-wire format, but does
|
||||
* contain all the information required by the driver to construct the
|
||||
* packet.
|
||||
*/
|
||||
struct ibhdr {
|
||||
/** Peer address */
|
||||
uint8_t peer[IB_ALEN];
|
||||
/** Network-layer protocol */
|
||||
uint16_t proto;
|
||||
/** Reserved, must be zero */
|
||||
uint16_t reserved;
|
||||
} __attribute__ (( packed ));
|
||||
|
||||
extern struct ll_protocol infiniband_protocol;
|
||||
|
||||
extern const char * ib_ntoa ( const void *ll_addr );
|
||||
|
||||
/**
|
||||
* Allocate Infiniband device
|
||||
*
|
||||
* @v priv_size Size of driver private data
|
||||
* @ret netdev Network device, or NULL
|
||||
*/
|
||||
static inline struct net_device * alloc_ibdev ( size_t priv_size ) {
|
||||
struct net_device *netdev;
|
||||
|
||||
netdev = alloc_netdev ( priv_size );
|
||||
if ( netdev ) {
|
||||
netdev->ll_protocol = &infiniband_protocol;
|
||||
}
|
||||
return netdev;
|
||||
}
|
||||
|
||||
#endif /* _GPXE_INFINIBAND_H */
|
||||
Reference in New Issue
Block a user