summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMithlesh Thukral <mithlesh@linsyssoft.com>2009-10-26 21:21:39 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2009-12-11 12:23:11 -0800
commitdba0da373d389b9e12bb739d25cbe116dee5f55b (patch)
treedfcfe58af37edc116703c3c406bfcd67669ae4a9 /drivers
parent3001fa0522b87cbd756896a7ffa30a38fdf7a388 (diff)
Staging: otus : checkpatch.pl cleanup for header files
Fix for checkpatch.pl errors and warnings in header files of otus driver. (There is a typedef which still remains. Plan to clean it up in next set of patches) Signed-off-by: Mithlesh Thukral <mithlesh@linsyssoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/otus/athr_common.h10
-rw-r--r--drivers/staging/otus/oal_dt.h10
-rw-r--r--drivers/staging/otus/oal_marc.h84
-rw-r--r--drivers/staging/otus/usbdrv.h140
-rw-r--r--drivers/staging/otus/zdusb.h4
5 files changed, 126 insertions, 122 deletions
diff --git a/drivers/staging/otus/athr_common.h b/drivers/staging/otus/athr_common.h
index 620f78a41d5f..3e32f5b4ac68 100644
--- a/drivers/staging/otus/athr_common.h
+++ b/drivers/staging/otus/athr_common.h
@@ -68,7 +68,7 @@
#define ZM_WAPI_KEY_SIZE 32
#define ZM_WAPI_IV_LEN 16
-#endif //ZM_ENALBE_WAPI
+#endif /* ZM_ENALBE_WAPI */
/* structure definition */
struct athr_wlan_param {
@@ -123,7 +123,7 @@ struct athr_wapi_param {
u8 key[ZM_WAPI_KEY_SIZE];
} crypt;
struct {
- u8 wapi_policy;
+ u8 wapi_policy;
} info;
} u;
};
@@ -132,10 +132,10 @@ struct athr_wapi_sta_info
{
u16 msg_type;
u16 datalen;
- u8 sta_mac[ETH_ALEN];
+ u8 sta_mac[ETH_ALEN];
u8 reserve_data[2];
- u8 gsn[ZM_WAPI_IV_LEN];
+ u8 gsn[ZM_WAPI_IV_LEN];
u8 wie[256];
};
-#endif //ZM_ENALBE_WAPI
+#endif /* ZM_ENALBE_WAPI */
#endif
diff --git a/drivers/staging/otus/oal_dt.h b/drivers/staging/otus/oal_dt.h
index e82b9770fca1..fb6d11a99cc5 100644
--- a/drivers/staging/otus/oal_dt.h
+++ b/drivers/staging/otus/oal_dt.h
@@ -39,15 +39,15 @@ typedef long s32_t;
typedef short s16_t;
typedef char s8_t;
-#ifndef TRUE
-#define TRUE (1==1)
+#ifndef TRUE
+#define TRUE (1 == 1)
#endif
-#ifndef FALSE
-#define FALSE (1==0)
+#ifndef FALSE
+#define FALSE (1 == 0)
#endif
-#ifndef NULL
+#ifndef NULL
#define NULL 0
#endif
diff --git a/drivers/staging/otus/oal_marc.h b/drivers/staging/otus/oal_marc.h
index 206111616a03..e7a9081b1a7c 100644
--- a/drivers/staging/otus/oal_marc.h
+++ b/drivers/staging/otus/oal_marc.h
@@ -34,17 +34,19 @@
/***** Critical section *****/
/* Declare for critical section */
#ifndef ZM_HALPLUS_LOCK
-#define zmw_get_wlan_dev(dev) struct zsWlanDev *wd = (struct zsWlanDev*) ((((struct usbdrv_private*)dev->priv)->wd))
+#define zmw_get_wlan_dev(dev) struct zsWlanDev *wd = (struct zsWlanDev *) \
+ ((((struct usbdrv_private *)dev->priv)->wd))
#define zmw_declare_for_critical_section() unsigned long irqFlag;
/* Enter critical section */
-#define zmw_enter_critical_section(dev) \
- spin_lock_irqsave(&(((struct usbdrv_private *)(dev->priv))->cs_lock), irqFlag);
+#define zmw_enter_critical_section(dev) spin_lock_irqsave( \
+ &(((struct usbdrv_private *)(dev->priv))->cs_lock), irqFlag);
/* leave critical section */
#define zmw_leave_critical_section(dev) \
- spin_unlock_irqrestore(&(((struct usbdrv_private *)(dev->priv))->cs_lock), irqFlag);
+ spin_unlock_irqrestore(&(((struct usbdrv_private *) \
+ (dev->priv))->cs_lock), irqFlag);
#else
#define zmw_get_wlan_dev(dev) struct zsWlanDev *wd = zfwGetWlanDev(dev);
@@ -52,31 +54,29 @@
#define zmw_declare_for_critical_section()
/* Enter critical section */
-#define zmw_enter_critical_section(dev) \
- zfwEnterCriticalSection(dev);
+#define zmw_enter_critical_section(dev) zfwEnterCriticalSection(dev);
/* leave critical section */
-#define zmw_leave_critical_section(dev) \
- zfwLeaveCriticalSection(dev);
+#define zmw_leave_critical_section(dev) zfwLeaveCriticalSection(dev);
#endif
/***** Byte order converting *****/
#ifdef ZM_CONFIG_BIG_ENDIAN
-#define zmw_cpu_to_le32(v) (((v & 0xff000000) >> 24) | \
- ((v & 0x00ff0000) >> 8) | \
- ((v & 0x0000ff00) << 8) | \
- ((v & 0x000000ff) << 24))
+#define zmw_cpu_to_le32(v) (((v & 0xff000000) >> 24) | \
+ ((v & 0x00ff0000) >> 8) | \
+ ((v & 0x0000ff00) << 8) | \
+ ((v & 0x000000ff) << 24))
-#define zmw_le32_to_cpu(v) (((v & 0xff000000) >> 24) | \
- ((v & 0x00ff0000) >> 8) | \
- ((v & 0x0000ff00) << 8) | \
- ((v & 0x000000ff) << 24))
+#define zmw_le32_to_cpu(v) (((v & 0xff000000) >> 24) | \
+ ((v & 0x00ff0000) >> 8) | \
+ ((v & 0x0000ff00) << 8) | \
+ ((v & 0x000000ff) << 24))
#define zmw_cpu_to_le16(v) (((v & 0xff00) >> 8) | \
- ((v & 0x00ff) << 8))
+ ((v & 0x00ff) << 8))
#define zmw_le16_to_cpu(v) (((v & 0xff00) >> 8) | \
- ((v & 0x00ff) << 8))
+ ((v & 0x00ff) << 8))
#else
#define zmw_cpu_to_le32(v) (v)
#define zmw_le32_to_cpu(v) (v)
@@ -88,33 +88,41 @@
/* Called to read/write buffer */
#ifndef ZM_HALPLUS_LOCK
-#define zmw_buf_readb(dev, buf, offset) *(u8_t*)((u8_t*)buf->data+offset)
-#define zmw_buf_readh(dev, buf, offset) zmw_cpu_to_le16(*(u16_t*)((u8_t*)buf->data+offset))
-#define zmw_buf_writeb(dev, buf, offset, value) *(u8_t*)((u8_t*)buf->data+offset) = value
-#define zmw_buf_writeh(dev, buf, offset, value) *(u16_t*)((u8_t*)buf->data+offset) = zmw_cpu_to_le16(value)
-#define zmw_buf_get_buffer(dev, buf) (u8_t*)(buf->data)
+#define zmw_buf_readb(dev, buf, offset) (*(u8_t *)((u8_t *)buf->data+offset))
+#define zmw_buf_readh(dev, buf, offset) zmw_cpu_to_le16(*(u16_t *) \
+ ((u8_t *)buf->data+offset))
+#define zmw_buf_writeb(dev, buf, offset, value) (*(u8_t *) \
+ ((u8_t *)buf->data+offset) = value)
+#define zmw_buf_writeh(dev, buf, offset, value) (*(u16_t *) \
+ ((u8_t *)buf->data+offset) = zmw_cpu_to_le16(value))
+#define zmw_buf_get_buffer(dev, buf) (u8_t *)(buf->data)
#else
#define zmw_buf_readb(dev, buf, offset) zfwBufReadByte(dev, buf, offset)
#define zmw_buf_readh(dev, buf, offset) zfwBufReadHalfWord(dev, buf, offset)
-#define zmw_buf_writeb(dev, buf, offset, value) zfwBufWriteByte(dev, buf, offset, value)
-#define zmw_buf_writeh(dev, buf, offset, value) zfwBufWriteHalfWord(dev, buf, offset, value)
+#define zmw_buf_writeb(dev, buf, offset, value) \
+ zfwBufWriteByte(dev, buf, offset, value)
+#define zmw_buf_writeh(dev, buf, offset, value) \
+ zfwBufWriteHalfWord(dev, buf, offset, value)
#define zmw_buf_get_buffer(dev, buf) zfwGetBuffer(dev, buf)
#endif
/***** Debug message *****/
#if 0
-#define zm_debug_msg0(msg) printk("%s:%s\n", __func__, msg);
-#define zm_debug_msg1(msg, val) printk("%s:%s%ld\n", __func__, \
- msg, (u32_t)val);
-#define zm_debug_msg2(msg, val) printk("%s:%s%lxh\n", __func__, \
- msg, (u32_t)val);
-#define zm_debug_msg_s(msg, val) printk("%s:%s%s\n", __func__, \
- msg, val);
-#define zm_debug_msg_p(msg, val1, val2) printk("%s:%s%01ld.%02ld\n", __func__, \
- msg, (val1/val2), (((val1*100)/val2)%100));
+#define zm_debug_msg0(msg) printk(KERN_DEBUG "%s:%s\n", __func__, msg);
+#define zm_debug_msg1(msg, val) printk(KERN_DEBUG "%s:%s%ld\n", __func__, \
+ msg, (u32_t)val);
+#define zm_debug_msg2(msg, val) printk(KERN_DEBUG "%s:%s%lxh\n", __func__, \
+ msg, (u32_t)val);
+#define zm_debug_msg_s(msg, val) printk(KERN_DEBUG "%s:%s%s\n", __func__, \
+ msg, val);
+#define zm_debug_msg_p(msg, val1, val2) do { \
+ printk(KERN_DEBUG "%s:%s%01ld.%02ld\n", \
+ __func__, \
+ msg, (val1/val2), (((val1*100)/val2)%100));
+ } while (0)
#define zm_dbg(S) printk S
#else
#define zm_debug_msg0(msg)
@@ -125,10 +133,10 @@
#define zm_dbg(S)
#endif
-#define zm_assert(expr) if(!(expr)) { \
- printk( "Atheors Assertion failed! %s,%s,%s,line=%d\n", \
- #expr,__FILE__,__func__,__LINE__); \
- }
+#define zm_assert(expr) if (!(expr)) { \
+ printk(KERN_ERR "Atheors Assertion failed! %s, %s, %s,line=%d\n",\
+ #expr, __FILE__, __func__, __LINE__); \
+ }
#define DbgPrint printk
diff --git a/drivers/staging/otus/usbdrv.h b/drivers/staging/otus/usbdrv.h
index 78004062caba..330d1b95cb88 100644
--- a/drivers/staging/otus/usbdrv.h
+++ b/drivers/staging/otus/usbdrv.h
@@ -45,7 +45,7 @@
#include "oal_dt.h"
#include "oal_marc.h"
#include "80211core/pub_zfi.h"
-//#include "pub_zfw.h"
+/* #include "pub_zfw.h" */
#include "80211core/pub_usb.h"
#include <linux/usb.h>
@@ -86,8 +86,7 @@ struct driver_stats {
#define ZM_MAX_RX_URB_NUM 16
#define ZM_MAX_TX_BUF_NUM 128
-typedef struct UsbTxQ
-{
+typedef struct UsbTxQ {
zbuf_t *buf;
u8_t hdr[80];
u16_t hdrlen;
@@ -100,17 +99,16 @@ typedef struct UsbTxQ
struct zdap_ioctl {
- u16_t cmd; /* Command to run */
- u32_t addr; /* Length of the data buffer */
- u32_t value; /* Pointer to the data buffer */
+ u16_t cmd; /* Command to run */
+ u32_t addr; /* Length of the data buffer */
+ u32_t value; /* Pointer to the data buffer */
u8_t data[0x100];
};
#define ZM_OAL_MAX_STA_SUPPORT 16
-struct usbdrv_private
-{
- //linux used
+struct usbdrv_private {
+ /* linux used */
struct net_device *device;
#if (WLAN_HOSTIF == WLAN_PCI)
struct pci_dev *pdev;
@@ -121,7 +119,7 @@ struct usbdrv_private
#endif
struct driver_stats drv_stats;
char ifname[IFNAMSIZ];
- int using_dac;
+ int using_dac;
u8_t rev_id; /* adapter PCI revision ID */
rwlock_t isolate_lock;
spinlock_t cs_lock;
@@ -130,78 +128,76 @@ struct usbdrv_private
void *regp;
#endif
- /* timer for heart beat */
+ /* timer for heart beat */
struct timer_list hbTimer10ms;
/* For driver core */
- void* wd;
+ void *wd;
#if (WLAN_HOSTIF == WLAN_USB)
- u8_t txUsbBuf[ZM_MAX_TX_URB_NUM][ZM_USB_TX_BUF_SIZE];
- u8_t regUsbReadBuf[ZM_USB_REG_MAX_BUF_SIZE];
- u8_t regUsbWriteBuf[ZM_USB_REG_MAX_BUF_SIZE];
+ u8_t txUsbBuf[ZM_MAX_TX_URB_NUM][ZM_USB_TX_BUF_SIZE];
+ u8_t regUsbReadBuf[ZM_USB_REG_MAX_BUF_SIZE];
+ u8_t regUsbWriteBuf[ZM_USB_REG_MAX_BUF_SIZE];
urb_t *WlanTxDataUrb[ZM_MAX_TX_URB_NUM];
urb_t *WlanRxDataUrb[ZM_MAX_RX_URB_NUM];
urb_t *RegOutUrb;
urb_t *RegInUrb;
- UsbTxQ_t UsbTxBufQ[ZM_MAX_TX_BUF_NUM];
- zbuf_t *UsbRxBufQ[ZM_MAX_RX_URB_NUM];
- u16_t TxBufHead;
- u16_t TxBufTail;
- u16_t TxBufCnt;
- u16_t TxUrbHead;
- u16_t TxUrbTail;
- u16_t TxUrbCnt;
- u16_t RxBufHead;
- u16_t RxBufTail;
- u16_t RxBufCnt;
+ UsbTxQ_t UsbTxBufQ[ZM_MAX_TX_BUF_NUM];
+ zbuf_t *UsbRxBufQ[ZM_MAX_RX_URB_NUM];
+ u16_t TxBufHead;
+ u16_t TxBufTail;
+ u16_t TxBufCnt;
+ u16_t TxUrbHead;
+ u16_t TxUrbTail;
+ u16_t TxUrbCnt;
+ u16_t RxBufHead;
+ u16_t RxBufTail;
+ u16_t RxBufCnt;
#endif
#if ZM_USB_STREAM_MODE == 1
- zbuf_t *reamin_buf;
+ zbuf_t *reamin_buf;
#endif
#ifdef ZM_HOSTAPD_SUPPORT
- struct athr_wlan_param athr_wpa_req;
+ struct athr_wlan_param athr_wpa_req;
#endif
- struct sock *netlink_sk;
- u8_t DeviceOpened; //CWYang(+)
- u8_t supIe[50];
- u8_t supLen;
- struct ieee80211req_wpaie stawpaie[ZM_OAL_MAX_STA_SUPPORT];
- u8_t forwardMgmt;
-
- struct zfCbUsbFuncTbl usbCbFunctions;
-
- /* For keventd */
- u32_t flags;
- unsigned long kevent_flags;
- u16_t kevent_ready;
-
- struct semaphore ioctl_sem;
- struct work_struct kevent;
- wait_queue_head_t wait_queue_event;
+ struct sock *netlink_sk;
+ u8_t DeviceOpened; /* CWYang(+) */
+ u8_t supIe[50];
+ u8_t supLen;
+ struct ieee80211req_wpaie stawpaie[ZM_OAL_MAX_STA_SUPPORT];
+ u8_t forwardMgmt;
+
+ struct zfCbUsbFuncTbl usbCbFunctions;
+
+ /* For keventd */
+ u32_t flags;
+ unsigned long kevent_flags;
+ u16_t kevent_ready;
+
+ struct semaphore ioctl_sem;
+ struct work_struct kevent;
+ wait_queue_head_t wait_queue_event;
#ifdef ZM_HALPLUS_LOCK
- unsigned long hal_irqFlag;
+ unsigned long hal_irqFlag;
#endif
- u16_t adapterState;
+ u16_t adapterState;
};
/* WDS */
#define ZM_WDS_PORT_NUMBER 6
-struct zsWdsStruct
-{
- struct net_device* dev;
+struct zsWdsStruct {
+ struct net_device *dev;
u16_t openFlag;
};
/* VAP */
#define ZM_VAP_PORT_NUMBER 7
-struct zsVapStruct
-{
- struct net_device* dev;
+struct zsVapStruct {
+ struct net_device *dev;
u16_t openFlag;
};
@@ -215,25 +211,25 @@ struct zsVapStruct
#define ZM_IOCTL_RXD_DUMP 0x07
#define ZM_IOCTL_MEM_READ 0x0B
#define ZM_IOCTL_MEM_WRITE 0x0C
-#define ZM_IOCTL_DMA_TEST 0x10
-#define ZM_IOCTL_REG_TEST 0x11
-#define ZM_IOCTL_TEST 0x80
-#define ZM_IOCTL_TALLY 0x81 //CWYang(+)
-#define ZM_IOCTL_RTS 0xA0
-#define ZM_IOCTL_MIX_MODE 0xA1
-#define ZM_IOCTL_FRAG 0xA2
-#define ZM_IOCTL_SCAN 0xA3
-#define ZM_IOCTL_KEY 0xA4
-#define ZM_IOCTL_RATE 0xA5
-#define ZM_IOCTL_ENCRYPTION_MODE 0xA6
-#define ZM_IOCTL_GET_TXCNT 0xA7
-#define ZM_IOCTL_GET_DEAGG_CNT 0xA8
-#define ZM_IOCTL_DURATION_MODE 0xA9
-#define ZM_IOCTL_SET_AES_KEY 0xAA
-#define ZM_IOCTL_SET_AES_MODE 0xAB
-#define ZM_IOCTL_SIGNAL_STRENGTH 0xAC //CWYang(+)
-#define ZM_IOCTL_SIGNAL_QUALITY 0xAD //CWYang(+)
-#define ZM_IOCTL_SET_PIBSS_MODE 0xAE
+#define ZM_IOCTL_DMA_TEST 0x10
+#define ZM_IOCTL_REG_TEST 0x11
+#define ZM_IOCTL_TEST 0x80
+#define ZM_IOCTL_TALLY 0x81 /* CWYang(+) */
+#define ZM_IOCTL_RTS 0xA0
+#define ZM_IOCTL_MIX_MODE 0xA1
+#define ZM_IOCTL_FRAG 0xA2
+#define ZM_IOCTL_SCAN 0xA3
+#define ZM_IOCTL_KEY 0xA4
+#define ZM_IOCTL_RATE 0xA5
+#define ZM_IOCTL_ENCRYPTION_MODE 0xA6
+#define ZM_IOCTL_GET_TXCNT 0xA7
+#define ZM_IOCTL_GET_DEAGG_CNT 0xA8
+#define ZM_IOCTL_DURATION_MODE 0xA9
+#define ZM_IOCTL_SET_AES_KEY 0xAA
+#define ZM_IOCTL_SET_AES_MODE 0xAB
+#define ZM_IOCTL_SIGNAL_STRENGTH 0xAC /* CWYang(+) */
+#define ZM_IOCTL_SIGNAL_QUALITY 0xAD /* CWYang(+) */
+#define ZM_IOCTL_SET_PIBSS_MODE 0xAE
#define ZDAPIOCTL SIOCDEVPRIVATE
diff --git a/drivers/staging/otus/zdusb.h b/drivers/staging/otus/zdusb.h
index 9f8ab2e96169..97e4ef09567a 100644
--- a/drivers/staging/otus/zdusb.h
+++ b/drivers/staging/otus/zdusb.h
@@ -34,10 +34,10 @@
#define VERSIONID "0.0.0.999"
/* Define these values to match your device */
-#define VENDOR_ATHR 0x0CF3 //Atheros
+#define VENDOR_ATHR 0x0CF3 /* Atheros */
#define PRODUCT_AR9170 0x9170
-#define VENDOR_DLINK 0x07D1 //Dlink
+#define VENDOR_DLINK 0x07D1 /* Dlink */
#define PRODUCT_DWA160A 0x3C10
#define VENDOR_NETGEAR 0x0846 /* NetGear */