mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-05 00:20:32 +00:00
Staging: RT2860: Fixed all warnings and errors in the iface directory
I have cleaned both files inside the iface directory (fileo rtmp_pci.h and rtmp_usb.h). I am not sure about some of the changes I have made however my adjustments have solved all errors. There were also a few issues on my machine with ap.h on my machine, however I have since cleaned that too. Signed-off-by: Neil Munro <neilmunro@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
39831861ff
commit
b0ea846105
3 changed files with 94 additions and 78 deletions
|
@ -32,7 +32,7 @@
|
|||
((struct os_cookie *)handle)->pci_dev = dev_p;
|
||||
|
||||
#ifdef LINUX
|
||||
// set driver data
|
||||
/* set driver data */
|
||||
#define RT28XX_DRVDATA_SET(_a) pci_set_drvdata(_a, net_dev);
|
||||
|
||||
#define RT28XX_PUT_DEVICE(dev_p)
|
||||
|
@ -42,7 +42,8 @@
|
|||
#ifdef PCI_MSI_SUPPORT
|
||||
#define RTMP_MSI_ENABLE(_pAd) \
|
||||
{ struct os_cookie *_pObj = (struct os_cookie *)(_pAd->OS_Cookie); \
|
||||
(_pAd)->HaveMsi = pci_enable_msi(_pObj->pci_dev) == 0 ? TRUE : FALSE; \
|
||||
(_pAd)->HaveMsi = pci_enable_msi(_pObj->pci_dev) \
|
||||
== 0 ? TRUE : FALSE; \
|
||||
}
|
||||
|
||||
#define RTMP_MSI_DISABLE(_pAd) \
|
||||
|
@ -54,25 +55,26 @@
|
|||
#else
|
||||
#define RTMP_MSI_ENABLE(_pAd) do {} while (0)
|
||||
#define RTMP_MSI_DISABLE(_pAd) do {} while (0)
|
||||
#endif // PCI_MSI_SUPPORT //
|
||||
#endif /* PCI_MSI_SUPPORT */
|
||||
|
||||
#define RTMP_PCI_DEV_UNMAP() \
|
||||
{ if (net_dev->base_addr) { \
|
||||
iounmap((void *)(net_dev->base_addr)); \
|
||||
release_mem_region(pci_resource_start(dev_p, 0), \
|
||||
pci_resource_len(dev_p, 0)); } \
|
||||
if (net_dev->irq) pci_release_regions(dev_p); }
|
||||
if (net_dev->irq) \
|
||||
pci_release_regions(dev_p); }
|
||||
|
||||
#define PCI_REG_READ_WORD(pci_dev, offset, Configuration) \
|
||||
#define PCI_REG_READ_WORD(pci_dev, offset, Configuration) {\
|
||||
if (pci_read_config_word(pci_dev, offset, ®16) == 0) \
|
||||
Configuration = le2cpu16(reg16); \
|
||||
else \
|
||||
Configuration = 0;
|
||||
Configuration = 0; }
|
||||
|
||||
#define PCI_REG_WIRTE_WORD(pci_dev, offset, Configuration) \
|
||||
#define PCI_REG_WIRTE_WORD(pci_dev, offset, Configuration) {\
|
||||
reg16 = cpu2le16(Configuration); \
|
||||
pci_write_config_word(pci_dev, offset, reg16);
|
||||
pci_write_config_word(pci_dev, offset, reg16); }
|
||||
|
||||
#endif // LINUX //
|
||||
#endif /* LINUX */
|
||||
|
||||
#endif // __RTMP_PCI_H__ //
|
||||
#endif /* __RTMP_PCI_H__ */
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
|
||||
#ifdef LINUX
|
||||
#include <linux/usb.h>
|
||||
#endif // LINUX //
|
||||
#endif /* LINUX */
|
||||
|
||||
extern u8 EpToQueue[6];
|
||||
|
||||
|
@ -42,8 +42,7 @@ extern u8 EpToQueue[6];
|
|||
#define MAX_RXBULK_SIZE (LOCAL_TXBUF_SIZE*RXBULKAGGRE_ZISE)
|
||||
#define MAX_MLME_HANDLER_MEMORY 20
|
||||
|
||||
// Flags for Bulkflags control for bulk out data
|
||||
//
|
||||
/* Flags for Bulkflags control for bulk out data */
|
||||
#define fRTUSB_BULK_OUT_DATA_NULL 0x00000001
|
||||
#define fRTUSB_BULK_OUT_RTS 0x00000002
|
||||
#define fRTUSB_BULK_OUT_MLME 0x00000004
|
||||
|
@ -59,12 +58,12 @@ extern u8 EpToQueue[6];
|
|||
#define fRTUSB_BULK_OUT_DATA_NORMAL_3 0x00040000
|
||||
#define fRTUSB_BULK_OUT_DATA_NORMAL_4 0x00080000
|
||||
|
||||
// TODO:move to ./ate/include/iface/ate_usb.h
|
||||
/* TODO:move to ./ate/include/iface/ate_usb.h */
|
||||
|
||||
#define FREE_HTTX_RING(_pCookie, _pipeId, _txContext) \
|
||||
{ \
|
||||
if ((_txContext)->ENextBulkOutPosition == (_txContext)->CurWritePosition) \
|
||||
{ \
|
||||
if ((_txContext)->ENextBulkOutPosition == \
|
||||
(_txContext)->CurWritePosition) {\
|
||||
(_txContext)->bRingEmpty = TRUE; \
|
||||
} \
|
||||
/*NdisInterlockedDecrement(&(_p)->TxCount); */\
|
||||
|
@ -80,13 +79,29 @@ extern u8 EpToQueue[6];
|
|||
#define BULKAGGRE_ZISE 100
|
||||
#define RT28XX_PUT_DEVICE usb_put_dev
|
||||
#define RTUSB_ALLOC_URB(iso) usb_alloc_urb(iso, GFP_ATOMIC)
|
||||
#define RTUSB_SUBMIT_URB(pUrb) usb_submit_urb(pUrb, GFP_ATOMIC)
|
||||
#define RTUSB_URB_ALLOC_BUFFER(pUsb_Dev, BufSize, pDma_addr) usb_alloc_coherent(pUsb_Dev, BufSize, GFP_ATOMIC, pDma_addr)
|
||||
#define RTUSB_URB_FREE_BUFFER(pUsb_Dev, BufSize, pTransferBuf, Dma_addr) usb_free_coherent(pUsb_Dev, BufSize, pTransferBuf, Dma_addr)
|
||||
#define RTUSB_SUBMIT_URB(pUrb) usb_submit_urb(pUrb, \
|
||||
GFP_ATOMIC)
|
||||
#define RTUSB_URB_ALLOC_BUFFER(pUsb_Dev, \
|
||||
BufSize, \
|
||||
pDma_addr) \
|
||||
usb_alloc_coherent(\
|
||||
pUsb_Dev, \
|
||||
BufSize, \
|
||||
GFP_ATOMIC, \
|
||||
pDma_addr)
|
||||
#define RTUSB_URB_FREE_BUFFER(pUsb_Dev, \
|
||||
BufSize, \
|
||||
pTransferBuf, \
|
||||
Dma_addr) \
|
||||
usb_free_coherent( \
|
||||
pUsb_Dev, \
|
||||
BufSize, \
|
||||
pTransferBuf, \
|
||||
Dma_addr)
|
||||
|
||||
#define RTUSB_FREE_URB(pUrb) usb_free_urb(pUrb)
|
||||
|
||||
// unlink urb
|
||||
/* unlink urb */
|
||||
#define RTUSB_UNLINK_URB(pUrb) usb_kill_urb(pUrb)
|
||||
|
||||
extern void dump_urb(struct urb *purb);
|
||||
|
@ -97,7 +112,7 @@ extern void dump_urb(struct urb *purb);
|
|||
#define NdisInterlockedDecrement atomic_dec
|
||||
#define InterlockedExchange atomic_set
|
||||
|
||||
#endif // LINUX //
|
||||
#endif /* LINUX */
|
||||
|
||||
#define NT_SUCCESS(status) (((status) >= 0) ? (TRUE) : (FALSE))
|
||||
|
||||
|
@ -112,7 +127,7 @@ extern void dump_urb(struct urb *purb);
|
|||
#define USB_ST_NOERROR 0
|
||||
#endif
|
||||
|
||||
// vendor-specific control operations
|
||||
/* vendor-specific control operations */
|
||||
#define CONTROL_TIMEOUT_JIFFIES ((100 * OS_HZ) / 1000)
|
||||
#define UNLINK_TIMEOUT_MS 3
|
||||
|
||||
|
@ -127,8 +142,7 @@ void RTUSBBulkRxComplete(struct urb *pUrb, struct pt_regs *pt_regs);
|
|||
#define RTUSBMlmeUp(pAd) \
|
||||
do { \
|
||||
struct rt_rtmp_os_task *_pTask = &((pAd)->mlmeTask);\
|
||||
if (_pTask->kthread_task) \
|
||||
{ \
|
||||
if (_pTask->kthread_task) {\
|
||||
_pTask->kthread_running = TRUE; \
|
||||
wake_up(&_pTask->kthread_q); \
|
||||
} \
|
||||
|
@ -167,8 +181,8 @@ void RTUSBBulkRxComplete(struct urb *pUrb, struct pt_regs *pt_regs);
|
|||
|
||||
#define DEVICE_VENDOR_REQUEST_OUT 0x40
|
||||
#define DEVICE_VENDOR_REQUEST_IN 0xc0
|
||||
//#define INTERFACE_VENDOR_REQUEST_OUT 0x41
|
||||
//#define INTERFACE_VENDOR_REQUEST_IN 0xc1
|
||||
/*#define INTERFACE_VENDOR_REQUEST_OUT 0x41*/
|
||||
/*#define INTERFACE_VENDOR_REQUEST_IN 0xc1*/
|
||||
|
||||
#define BULKOUT_MGMT_RESET_FLAG 0x80
|
||||
|
||||
|
@ -179,4 +193,4 @@ void RTUSBBulkRxComplete(struct urb *pUrb, struct pt_regs *pt_regs);
|
|||
#define RTMP_IRQ_REQUEST(net_dev) do {} while (0)
|
||||
#define RTMP_IRQ_RELEASE(net_dev) do {} while (0)
|
||||
|
||||
#endif // __RTMP_USB_H__ //
|
||||
#endif /* __RTMP_USB_H__ */
|
||||
|
|
Loading…
Reference in a new issue