#include <ipxe/net80211.h>
/* This block of functions are from kernel.h v3.0.1 */
-#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
#define BITS_PER_BYTE 8
#define BITS_TO_LONGS(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(long))
#undef ERRFILE
#define ERRFILE ERRFILE_ath5k
-#define ARRAY_SIZE(a) (sizeof(a)/sizeof((a)[0]))
-
/* RX/TX descriptor hw structs */
#include "desc.h"
#ifndef _FORCEDETH_H_
#define _FORCEDETH_H_
-#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
-
struct ring_desc {
u32 buf;
u32 flaglen;
#ifndef _PCNET32_H_
#define _PCNET32_H_
-#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
-
/*
* Set the number of Tx and Rx buffers, using Log_2(# buffers).
* Set default values to 16 Tx buffers and 32 Rx buffers.
#define RTL8225_ANAPARAM2_OFF 0x840dec11
#define min(a,b) (((a)<(b))?(a):(b))
-#define ARRAY_SIZE(a) (int)(sizeof(a)/sizeof((a)[0]))
static inline void rtl8225_write_phy_ofdm(struct net80211_device *dev,
u8 addr, u8 data)
static void rtl8225_rf_init(struct net80211_device *dev)
{
struct rtl818x_priv *priv = dev->priv;
- int i;
+ unsigned int i;
rtl818x_set_anaparam(priv, RTL8225_ANAPARAM_ON);
static void rtl8225z2_rf_init(struct net80211_device *dev)
{
struct rtl818x_priv *priv = dev->priv;
- int i;
+ unsigned int i;
rtl818x_set_anaparam(priv, RTL8225_ANAPARAM_ON);
#define SUPPORTED_TP (1 << 7)
#define SUPPORTED_FIBRE (1 << 10)
-/* from kernel.h */
-#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
-
/* ----------------------------------- */
#define PCI_STATUS_ERROR_BITS (PCI_STATUS_DETECTED_PARITY | \
u16 subsystem_device;
};
-#define ARRAY_SIZE(x) ( sizeof(x) / sizeof((x)[0]) )
-
#define TG3_TX_RING_SIZE 512
#define TG3_DEF_TX_RING_PENDING (TG3_TX_RING_SIZE - 1)
#define WAIT_FACTOR 1
-#ifndef ARRAY_SIZE
-#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
-#endif
-
#define VXGE_HW_MAC_MAX_WIRE_PORTS 2
#define VXGE_HW_MAC_MAX_AGGR_PORTS 2
#define VXGE_HW_MAC_MAX_PORTS 3
#define barrier() __asm__ __volatile__ ( "" : : : "memory" )
#endif /* ASSEMBLY */
+/**
+ * Array size
+ */
+#ifndef ASSEMBLY
+#define ARRAY_SIZE(array) ( sizeof (array) / sizeof ( (array)[0] ) )
+#endif /* ASSEMBLY */
+
/**
* @defgroup licences Licence declarations
*