aboutsummaryrefslogtreecommitdiffstats
path: root/gpxe/src/include
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-06-04 18:52:18 -0700
committerH. Peter Anvin <hpa@zytor.com>2008-06-04 18:52:18 -0700
commite63132bf03140d91ec74eca663f7bc2f16429fb0 (patch)
treeea5af9895146e85d3912584e699799863e0f8a29 /gpxe/src/include
parentbce8e1595ab30c828254038523e1e25c9fd9445f (diff)
downloadsyslinux.git-e63132bf03140d91ec74eca663f7bc2f16429fb0.tar.gz
syslinux.git-e63132bf03140d91ec74eca663f7bc2f16429fb0.tar.xz
syslinux.git-e63132bf03140d91ec74eca663f7bc2f16429fb0.zip
Update gPXE from gPXE git
Diffstat (limited to 'gpxe/src/include')
-rw-r--r--gpxe/src/include/ctype.h7
-rw-r--r--gpxe/src/include/gpxe/errfile.h2
-rw-r--r--gpxe/src/include/gpxe/infiniband.h54
-rw-r--r--gpxe/src/include/gpxe/init.h5
-rw-r--r--gpxe/src/include/gpxe/ipoib.h1
-rw-r--r--gpxe/src/include/gpxe/iscsi.h12
-rw-r--r--gpxe/src/include/gpxe/netdevice.h34
-rw-r--r--gpxe/src/include/gpxe/pci.h3
-rw-r--r--gpxe/src/include/gpxe/serial.h14
-rw-r--r--gpxe/src/include/gpxe/uuid.h6
-rw-r--r--gpxe/src/include/usr/ifmgmt.h1
11 files changed, 125 insertions, 14 deletions
diff --git a/gpxe/src/include/ctype.h b/gpxe/src/include/ctype.h
index a79395d2..7740443d 100644
--- a/gpxe/src/include/ctype.h
+++ b/gpxe/src/include/ctype.h
@@ -6,10 +6,9 @@
* Character types
*/
-#define isdigit(c) ((c & 0x04) != 0)
-#define islower(c) ((c & 0x02) != 0)
-//#define isspace(c) ((c & 0x20) != 0)
-#define isupper(c) ((c & 0x01) != 0)
+#define isdigit(c) ((c) >= '0' && (c) <= '9')
+#define islower(c) ((c) >= 'a' && (c) <= 'z')
+#define isupper(c) ((c) >= 'A' && (c) <= 'Z')
static inline unsigned char tolower(unsigned char c)
{
diff --git a/gpxe/src/include/gpxe/errfile.h b/gpxe/src/include/gpxe/errfile.h
index ae8b1480..42952d7d 100644
--- a/gpxe/src/include/gpxe/errfile.h
+++ b/gpxe/src/include/gpxe/errfile.h
@@ -104,6 +104,7 @@
#define ERRFILE_ipoib ( ERRFILE_DRIVER | 0x00470000 )
#define ERRFILE_e1000 ( ERRFILE_DRIVER | 0x00480000 )
#define ERRFILE_e1000_hw ( ERRFILE_DRIVER | 0x00490000 )
+#define ERRFILE_mtnic ( ERRFILE_DRIVER | 0x004a0000 )
#define ERRFILE_scsi ( ERRFILE_DRIVER | 0x00700000 )
#define ERRFILE_arbel ( ERRFILE_DRIVER | 0x00710000 )
@@ -151,6 +152,7 @@
#define ERRFILE_uri_test ( ERRFILE_OTHER | 0x000b0000 )
#define ERRFILE_ibft ( ERRFILE_OTHER | 0x000c0000 )
#define ERRFILE_tls ( ERRFILE_OTHER | 0x000d0000 )
+#define ERRFILE_ifmgmt ( ERRFILE_OTHER | 0x000e0000 )
/** @} */
diff --git a/gpxe/src/include/gpxe/infiniband.h b/gpxe/src/include/gpxe/infiniband.h
index 354dc579..f9e65348 100644
--- a/gpxe/src/include/gpxe/infiniband.h
+++ b/gpxe/src/include/gpxe/infiniband.h
@@ -8,6 +8,7 @@
*/
#include <stdint.h>
+#include <gpxe/refcnt.h>
#include <gpxe/device.h>
/** Subnet administrator QPN */
@@ -95,6 +96,11 @@ struct ib_queue_pair {
void *owner_priv;
};
+/** Infiniband queue pair modification flags */
+enum ib_queue_pair_mods {
+ IB_MODIFY_QKEY = 0x0001,
+};
+
/** An Infiniband Completion Queue */
struct ib_completion_queue {
/** Completion queue number */
@@ -187,6 +193,16 @@ struct ib_device_operations {
*/
int ( * create_qp ) ( struct ib_device *ibdev,
struct ib_queue_pair *qp );
+ /** Modify queue pair
+ *
+ * @v ibdev Infiniband device
+ * @v qp Queue pair
+ * @v mod_list Modification list
+ * @ret rc Return status code
+ */
+ int ( * modify_qp ) ( struct ib_device *ibdev,
+ struct ib_queue_pair *qp,
+ unsigned long mod_list );
/** Destroy queue pair
*
* @v ibdev Infiniband device
@@ -240,6 +256,12 @@ struct ib_device_operations {
ib_completer_t complete_send,
ib_completer_t complete_recv );
/**
+ * Poll event queue
+ *
+ * @v ibdev Infiniband device
+ */
+ void ( * poll_eq ) ( struct ib_device *ibdev );
+ /**
* Open port
*
* @v ibdev Infiniband device
@@ -285,12 +307,18 @@ struct ib_device_operations {
/** An Infiniband device */
struct ib_device {
+ /** Reference counter */
+ struct refcnt refcnt;
+ /** List of Infiniband devices */
+ struct list_head list;
/** Underlying device */
struct device *dev;
/** Infiniband operations */
struct ib_device_operations *op;
/** Port number */
unsigned int port;
+ /** Link state */
+ int link_up;
/** Port GID */
struct ib_gid port_gid;
/** Subnet manager LID */
@@ -311,6 +339,8 @@ extern struct ib_queue_pair *
ib_create_qp ( struct ib_device *ibdev, unsigned int num_send_wqes,
struct ib_completion_queue *send_cq, unsigned int num_recv_wqes,
struct ib_completion_queue *recv_cq, unsigned long qkey );
+extern int ib_modify_qp ( struct ib_device *ibdev, struct ib_queue_pair *qp,
+ unsigned long mod_list, unsigned long qkey );
extern void ib_destroy_qp ( struct ib_device *ibdev,
struct ib_queue_pair *qp );
extern struct ib_work_queue * ib_find_wq ( struct ib_completion_queue *cq,
@@ -318,7 +348,7 @@ extern struct ib_work_queue * ib_find_wq ( struct ib_completion_queue *cq,
extern struct ib_device * alloc_ibdev ( size_t priv_size );
extern int register_ibdev ( struct ib_device *ibdev );
extern void unregister_ibdev ( struct ib_device *ibdev );
-extern void free_ibdev ( struct ib_device *ibdev );
+extern void ib_link_state_changed ( struct ib_device *ibdev );
/**
* Post send work queue entry
@@ -425,6 +455,28 @@ ib_mad ( struct ib_device *ibdev, struct ib_mad_hdr *mad, size_t len ) {
}
/**
+ * Get reference to Infiniband device
+ *
+ * @v ibdev Infiniband device
+ * @ret ibdev Infiniband device
+ */
+static inline __attribute__ (( always_inline )) struct ib_device *
+ibdev_get ( struct ib_device *ibdev ) {
+ ref_get ( &ibdev->refcnt );
+ return ibdev;
+}
+
+/**
+ * Drop reference to Infiniband device
+ *
+ * @v ibdev Infiniband device
+ */
+static inline __attribute__ (( always_inline )) void
+ibdev_put ( struct ib_device *ibdev ) {
+ ref_put ( &ibdev->refcnt );
+}
+
+/**
* Set Infiniband work queue driver-private data
*
* @v wq Work queue
diff --git a/gpxe/src/include/gpxe/init.h b/gpxe/src/include/gpxe/init.h
index d83aa5e5..c468213e 100644
--- a/gpxe/src/include/gpxe/init.h
+++ b/gpxe/src/include/gpxe/init.h
@@ -22,8 +22,9 @@ struct init_fn {
*/
#define INIT_EARLY 01 /**< Early initialisation */
-#define INIT_CONSOLE 02 /**< Console initialisation */
-#define INIT_NORMAL 03 /**< Normal initialisation */
+#define INIT_SERIAL 02 /**< Serial driver initialisation */
+#define INIT_CONSOLE 03 /**< Console initialisation */
+#define INIT_NORMAL 04 /**< Normal initialisation */
/** @} */
diff --git a/gpxe/src/include/gpxe/ipoib.h b/gpxe/src/include/gpxe/ipoib.h
index 0551687d..bcbdc4c6 100644
--- a/gpxe/src/include/gpxe/ipoib.h
+++ b/gpxe/src/include/gpxe/ipoib.h
@@ -72,6 +72,7 @@ static inline struct net_device * alloc_ipoibdev ( size_t priv_size ) {
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 );
diff --git a/gpxe/src/include/gpxe/iscsi.h b/gpxe/src/include/gpxe/iscsi.h
index e4df6849..5c446757 100644
--- a/gpxe/src/include/gpxe/iscsi.h
+++ b/gpxe/src/include/gpxe/iscsi.h
@@ -224,10 +224,14 @@ struct iscsi_bhs_login_response {
#define ISCSI_OPCODE_LOGIN_RESPONSE 0x23
/* Login response status codes */
-#define ISCSI_STATUS_SUCCESS 0x00
-#define ISCSI_STATUS_REDIRECT 0x01
-#define ISCSI_STATUS_INITIATOR_ERROR 0x02
-#define ISCSI_STATUS_TARGET_ERROR 0x03
+#define ISCSI_STATUS_SUCCESS 0x00
+#define ISCSI_STATUS_REDIRECT 0x01
+#define ISCSI_STATUS_INITIATOR_ERROR 0x02
+#define ISCSI_STATUS_INITIATOR_ERROR_AUTHENTICATION 0x01
+#define ISCSI_STATUS_INITIATOR_ERROR_AUTHORISATION 0x02
+#define ISCSI_STATUS_INITIATOR_ERROR_NOT_FOUND 0x03
+#define ISCSI_STATUS_INITIATOR_ERROR_REMOVED 0x04
+#define ISCSI_STATUS_TARGET_ERROR 0x03
/**
* iSCSI SCSI command basic header segment
diff --git a/gpxe/src/include/gpxe/netdevice.h b/gpxe/src/include/gpxe/netdevice.h
index d8cb84d0..1ef648e1 100644
--- a/gpxe/src/include/gpxe/netdevice.h
+++ b/gpxe/src/include/gpxe/netdevice.h
@@ -254,6 +254,9 @@ struct net_device {
/** Network device is open */
#define NETDEV_OPEN 0x0001
+/** Network device has link */
+#define NETDEV_LINK_UP 0x0002
+
/** Declare a link-layer protocol */
#define __ll_protocol __table ( struct ll_protocol, ll_protocols, 01 )
@@ -352,6 +355,37 @@ netdev_settings ( struct net_device *netdev ) {
return &netdev->settings.settings;
}
+/**
+ * Mark network device as having link up
+ *
+ * @v netdev Network device
+ */
+static inline __attribute__ (( always_inline )) void
+netdev_link_up ( struct net_device *netdev ) {
+ netdev->state |= NETDEV_LINK_UP;
+}
+
+/**
+ * Mark network device as having link down
+ *
+ * @v netdev Network device
+ */
+static inline __attribute__ (( always_inline )) void
+netdev_link_down ( struct net_device *netdev ) {
+ netdev->state &= ~NETDEV_LINK_UP;
+}
+
+/**
+ * Check link state of network device
+ *
+ * @v netdev Network device
+ * @ret link_up Link is up
+ */
+static inline __attribute__ (( always_inline )) int
+netdev_link_ok ( struct net_device *netdev ) {
+ return ( netdev->state & NETDEV_LINK_UP );
+}
+
extern int netdev_tx ( struct net_device *netdev, struct io_buffer *iobuf );
extern void netdev_tx_complete_err ( struct net_device *netdev,
struct io_buffer *iobuf, int rc );
diff --git a/gpxe/src/include/gpxe/pci.h b/gpxe/src/include/gpxe/pci.h
index b5c417c9..fdcecb6d 100644
--- a/gpxe/src/include/gpxe/pci.h
+++ b/gpxe/src/include/gpxe/pci.h
@@ -30,7 +30,10 @@
#define PCI_COMMAND_IO 0x1 /* Enable response in I/O space */
#define PCI_COMMAND_MEM 0x2 /* Enable response in mem space */
#define PCI_COMMAND_MASTER 0x4 /* Enable bus mastering */
+
+#define PCI_CACHE_LINE_SIZE 0x0c /* 8 bits */
#define PCI_LATENCY_TIMER 0x0d /* 8 bits */
+
#define PCI_COMMAND_SPECIAL 0x8 /* Enable response to special cycles */
#define PCI_COMMAND_INVALIDATE 0x10 /* Use memory write and invalidate */
#define PCI_COMMAND_VGA_PALETTE 0x20 /* Enable palette snooping */
diff --git a/gpxe/src/include/gpxe/serial.h b/gpxe/src/include/gpxe/serial.h
new file mode 100644
index 00000000..2825b936
--- /dev/null
+++ b/gpxe/src/include/gpxe/serial.h
@@ -0,0 +1,14 @@
+#ifndef _GPXE_SERIAL_H
+#define _GPXE_SERIAL_H
+
+/** @file
+ *
+ * Serial driver functions
+ *
+ */
+
+extern void serial_putc ( int ch );
+extern int serial_getc ( void );
+extern int serial_ischar ( void );
+
+#endif /* _GPXE_SERIAL_H */
diff --git a/gpxe/src/include/gpxe/uuid.h b/gpxe/src/include/gpxe/uuid.h
index 4f89be50..18d1f141 100644
--- a/gpxe/src/include/gpxe/uuid.h
+++ b/gpxe/src/include/gpxe/uuid.h
@@ -12,11 +12,11 @@
union uuid {
/** Canonical form (00000000-0000-0000-0000-000000000000) */
struct {
- /** 8 hex digits, little-endian */
+ /** 8 hex digits, big-endian */
uint32_t a;
- /** 2 hex digits, little-endian */
+ /** 2 hex digits, big-endian */
uint16_t b;
- /** 2 hex digits, little-endian */
+ /** 2 hex digits, big-endian */
uint16_t c;
/** 2 hex digits, big-endian */
uint16_t d;
diff --git a/gpxe/src/include/usr/ifmgmt.h b/gpxe/src/include/usr/ifmgmt.h
index c7d35da8..7b49d349 100644
--- a/gpxe/src/include/usr/ifmgmt.h
+++ b/gpxe/src/include/usr/ifmgmt.h
@@ -12,5 +12,6 @@ struct net_device;
extern int ifopen ( struct net_device *netdev );
extern void ifclose ( struct net_device *netdev );
extern void ifstat ( struct net_device *netdev );
+extern int iflinkwait ( struct net_device *netdev, unsigned int max_wait_ms );
#endif /* _USR_IFMGMT_H */