mirror of
https://github.com/ipxe/ipxe
synced 2025-12-26 01:22:37 +03:00
Started IB driver rewrite
This commit is contained in:
@@ -123,6 +123,7 @@
|
||||
#define ERRFILE_dhcp ( ERRFILE_NET | 0x00100000 )
|
||||
#define ERRFILE_dns ( ERRFILE_NET | 0x00110000 )
|
||||
#define ERRFILE_tftp ( ERRFILE_NET | 0x00120000 )
|
||||
#define ERRFILE_infiniband ( ERRFILE_NET | 0x00130000 )
|
||||
|
||||
#define ERRFILE_image ( ERRFILE_IMAGE | 0x00000000 )
|
||||
#define ERRFILE_elf ( ERRFILE_IMAGE | 0x00010000 )
|
||||
|
||||
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 */
|
||||
@@ -19,10 +19,10 @@ struct ll_protocol;
|
||||
struct device;
|
||||
|
||||
/** Maximum length of a link-layer address */
|
||||
#define MAX_LL_ADDR_LEN 6
|
||||
#define MAX_LL_ADDR_LEN 20
|
||||
|
||||
/** Maximum length of a link-layer header */
|
||||
#define MAX_LL_HEADER_LEN 16
|
||||
#define MAX_LL_HEADER_LEN 32
|
||||
|
||||
/** Maximum length of a network-layer address */
|
||||
#define MAX_NET_ADDR_LEN 4
|
||||
|
||||
Reference in New Issue
Block a user