From: Jim C. <jim...@gm...> - 2012-04-30 08:56:00
|
Include pci.h in pci.c, and fix all the compile errs. An earlier patch changed all static decls in pci.h to STATick, which was #defined to nothing. This was useful at the time, but was certainly overkill; this starts to correct that. pci.h isnt quite correct in the long-run, but making pci.c consistent with it exposes potential bugs. pci.c: change fn-protos and fn-defns to match with those of pci.h. pci.h: one change, to hide (//=) acxpci_verify_init()'s prototype. This too may be merge-able, but we're taking human-sized bites. Eventually, will drop all //= protos, and all statics from pci.h, except the inlines (and maybe drop "static" there too). In pci.c, drop //= and reorder fn-defns to remove need for protos, except for real forward-decls. Tested-by: jimc - ifups Signed-off-by: Jim Cromie <jim...@gm...> --- pci.c | 71 ++++++++++++++++++++++++++++++++++++++-------------------------- pci.h | 2 +- 2 files changed, 43 insertions(+), 30 deletions(-) diff --git a/pci.c b/pci.c index eb08174..096e1fb 100644 --- a/pci.c +++ b/pci.c @@ -50,6 +50,7 @@ #endif #include "acx.h" +#include "pci.h" #include "merge.h" /* @@ -86,7 +87,7 @@ void acxpci_create_desc_queues(acx_device_t * adev, u32 tx_queue_start, u32 rx_q //= static void acxpci_create_tx_desc_queue(acx_device_t * adev, u32 tx_queue_start); //= void acxpci_free_desc_queues(acx_device_t * adev); -static void acxpci_delete_dma_regions(acx_device_t * adev); +//= static void acxpci_delete_dma_regions(acx_device_t * adev); //=static inline void acxpci_free_coherent(struct pci_dev *hwdev, size_t size, void *vaddr, dma_addr_t dma_handle); //= static void *acxpci_allocate(acx_device_t * adev, size_t size, dma_addr_t * phy, const char *msg); @@ -95,14 +96,14 @@ void acxpci_free_coherent(struct pci_dev *hwdev, size_t size, void *vaddr, dma_a int acxpci_upload_radio(acx_device_t * adev); //=int acxpci_read_eeprom_byte(acx_device_t * adev, u32 addr, u8 * charbuf); // int acxpci_s_write_eeprom(acx_device_t * adev, u32 addr, u32 len, const u8 * charbuf); -static inline void acxpci_read_eeprom_area(acx_device_t * adev); +//= static inline void acxpci_read_eeprom_area(acx_device_t * adev); //int acxpci_read_phy_reg(acx_device_t * adev, u32 reg, u8 * charbuf); int acxpci_write_phy_reg(acx_device_t * adev, u32 reg, u8 value); // static int acxpci_write_fw(acx_device_t * adev, const firmware_image_t *fw_image, u32 offset); // static int acxpci_validate_fw(acx_device_t * adev, const firmware_image_t *fw_image, u32 offset); -static int acxpci_upload_fw(acx_device_t * adev); +//= static int acxpci_upload_fw(acx_device_t * adev); // static void acx_show_card_eeprom_id(acx_device_t * adev); // CMDs (Control Path) @@ -110,12 +111,12 @@ int acxpci_issue_cmd_timeo_debug(acx_device_t * adev, unsigned cmd, void *buffer static inline void acxpci_write_cmd_type_status(acx_device_t * adev, u16 type, u16 status); //= static u32 acxpci_read_cmd_type_status(acx_device_t *adev); -static inline void acxpci_init_mboxes(acx_device_t * adev); +//= static inline void acxpci_init_mboxes(acx_device_t * adev); // Init, Configuration (Control Path) int acxpci_reset_dev(acx_device_t * adev); static int acxpci_verify_init(acx_device_t * adev); -static void acxpci_reset_mac(acx_device_t * adev); +//= static void acxpci_reset_mac(acx_device_t * adev); //= static void acxpci_up(struct ieee80211_hw *hw); // Other (Control Path) @@ -125,7 +126,7 @@ int acxpci_proc_diag_output(struct seq_file *file, acx_device_t *adev); //=char *acxpci_proc_eeprom_output(int *len, acx_device_t * adev); // Rx Path -static void acxpci_process_rxdesc(acx_device_t * adev); +//= static void acxpci_process_rxdesc(acx_device_t * adev); // Tx Path tx_t *acxpci_alloc_tx(acx_device_t * adev); @@ -133,10 +134,10 @@ void *acxpci_get_txbuf(acx_device_t * adev, tx_t * tx_opaque); void acxpci_tx_data(acx_device_t *adev, tx_t *tx_opaque, int len, struct ieee80211_tx_info *info, struct sk_buff *skb); unsigned int acxpci_tx_clean_txdesc(acx_device_t * adev); void acxpci_clean_txdesc_emergency(acx_device_t * adev); -static inline txdesc_t *acxpci_get_txdesc(acx_device_t * adev, int index); +//= static inline txdesc_t *acxpci_get_txdesc(acx_device_t * adev, int index); // static inline txdesc_t *acxpci_advance_txdesc(acx_device_t * adev, txdesc_t * txdesc, int inc); -static txhostdesc_t *acxpci_get_txhostdesc(acx_device_t * adev, txdesc_t * txdesc); +//= static txhostdesc_t *acxpci_get_txhostdesc(acx_device_t * adev, txdesc_t * txdesc); // Irq Handling, Timer //= static void acxpci_irq_enable(acx_device_t * adev); @@ -161,11 +162,11 @@ int acx100pci_ioctl_set_phy_amp_bias(struct net_device *ndev, struct iw_request_ // Driver, Module #ifdef CONFIG_PCI -static int __devinit acxpci_probe(struct pci_dev *pdev, const struct pci_device_id *id); -static void __devexit acxpci_remove(struct pci_dev *pdev); +//= static int __devinit acxpci_probe(struct pci_dev *pdev, const struct pci_device_id *id); +//= static void __devexit acxpci_remove(struct pci_dev *pdev); #ifdef CONFIG_PM -static int acxpci_e_suspend(struct pci_dev *pdev, pm_message_t state); -static int acxpci_e_resume(struct pci_dev *pdev); +//= static int acxpci_e_suspend(struct pci_dev *pdev, pm_message_t state); +//= static int acxpci_e_resume(struct pci_dev *pdev); #endif #endif @@ -404,7 +405,8 @@ static void acxpci_create_tx_desc_queue(acx_device_t * adev, u32 tx_queue_start) * function can be used if only part of the queues were allocated. */ -static void acxpci_delete_dma_regions(acx_device_t * adev) +//static +void acxpci_delete_dma_regions(acx_device_t * adev) { FN_ENTER; /* disable radio Tx/Rx. Shouldn't we use the firmware commands @@ -538,7 +540,8 @@ end: } #endif /* UNUSED */ -static inline void acxpci_read_eeprom_area(acx_device_t * adev) +//static +inline void acxpci_read_eeprom_area(acx_device_t * adev) { #if ACX_DEBUG > 1 int offs; @@ -730,7 +733,8 @@ acxpci_validate_fw(acx_device_t * adev, const firmware_image_t *fw_image, * * Origin: Derived from FW dissection */ -static int acxpci_upload_fw(acx_device_t * adev) +// static +int acxpci_upload_fw(acx_device_t * adev) { firmware_image_t *fw_image = NULL; int res = NOT_OK; @@ -1112,7 +1116,8 @@ u32 acxpci_read_cmd_type_status(acx_device_t *adev) return cmd_status; } -static inline void acxpci_init_mboxes(acx_device_t * adev) +// static +inline void acxpci_init_mboxes(acx_device_t * adev) { u32 cmd_offs, info_offs; @@ -1245,6 +1250,7 @@ int acxpci_reset_dev(acx_device_t * adev) return result; } +#if 1 // !unused static int acxpci_verify_init(acx_device_t * adev) { int result = NOT_OK; @@ -1270,6 +1276,7 @@ static int acxpci_verify_init(acx_device_t * adev) FN_EXIT1(result); return result; } +#endif // unused acxpci_verify_init() /* * acxpci_l_reset_mac @@ -1279,7 +1286,8 @@ static int acxpci_verify_init(acx_device_t * adev) * * Origin: Standard Read/Write to IO */ -static void acxpci_reset_mac(acx_device_t * adev) +//static +void acxpci_reset_mac(acx_device_t * adev) { u16 temp; @@ -1424,7 +1432,8 @@ int acxpci_proc_diag_output(struct seq_file *file, acx_device_t *adev) * * Called directly and only from the IRQ handler */ -static void acxpci_process_rxdesc(acx_device_t * adev) +// static +void acxpci_process_rxdesc(acx_device_t * adev) { register rxhostdesc_t *hostdesc; unsigned count, tail; @@ -1854,21 +1863,23 @@ void acxpci_clean_txdesc_emergency(acx_device_t * adev) FN_EXIT0; } - -static inline txdesc_t *acxpci_get_txdesc(acx_device_t * adev, int index) +// static +inline txdesc_t *acxpci_get_txdesc(acx_device_t * adev, int index) { return (txdesc_t *) (((u8 *) adev->txdesc_start) + index * adev->txdesc_size); } // static inline -txdesc_t *acxpci_advance_txdesc(acx_device_t * adev, txdesc_t * txdesc, +txdesc_t *acxpci_advance_txdesc(acx_device_t *adev, txdesc_t *txdesc, int inc) { return (txdesc_t *) (((u8 *) txdesc) + inc * adev->txdesc_size); } -static txhostdesc_t *acxpci_get_txhostdesc(acx_device_t * adev, txdesc_t * txdesc) +#if 1 // merge soon +// static +txhostdesc_t *acxpci_get_txhostdesc(acx_device_t *adev, txdesc_t *txdesc) { int index = (u8 *) txdesc - (u8 *) adev->txdesc_start; @@ -1888,7 +1899,7 @@ static txhostdesc_t *acxpci_get_txhostdesc(acx_device_t * adev, txdesc_t * txdes return &adev->txhostdesc_start[index * 2]; } - +#endif // acxpci_get_txhostdesc() /* * BOM Irq Handling, Timer @@ -2553,7 +2564,8 @@ static const u16 IO_ACX111[] = { }; #ifdef CONFIG_PCI -static int __devinit +// static +int __devinit acxpci_probe(struct pci_dev *pdev, const struct pci_device_id *id) { acx111_ie_configoption_t co; @@ -2909,7 +2921,8 @@ acxpci_probe(struct pci_dev *pdev, const struct pci_device_id *id) * * pdev - ptr to PCI device structure containing info about pci configuration */ -static void __devexit acxpci_remove(struct pci_dev *pdev) +// static +void __devexit acxpci_remove(struct pci_dev *pdev) { struct ieee80211_hw *hw = (struct ieee80211_hw *)pci_get_drvdata(pdev); acx_device_t *adev = ieee2adev(hw); @@ -3015,8 +3028,8 @@ static void __devexit acxpci_remove(struct pci_dev *pdev) ** TODO: PM code needs to be fixed / debugged / tested. */ #ifdef CONFIG_PM -static int -acxpci_e_suspend(struct pci_dev *pdev, pm_message_t state) +// static +int acxpci_e_suspend(struct pci_dev *pdev, pm_message_t state) { struct ieee80211_hw *hw = pci_get_drvdata(pdev); acx_device_t *adev; @@ -3047,8 +3060,8 @@ acxpci_e_suspend(struct pci_dev *pdev, pm_message_t state) return OK; } - -static int acxpci_e_resume(struct pci_dev *pdev) +//static +int acxpci_e_resume(struct pci_dev *pdev) { struct ieee80211_hw *hw = pci_get_drvdata(pdev); acx_device_t *adev; diff --git a/pci.h b/pci.h index 69bcb62..d339c0a 100644 --- a/pci.h +++ b/pci.h @@ -49,7 +49,7 @@ STATick inline void acxpci_init_mboxes(acx_device_t * adev); // Init, Configuration (Control Path) int acxpci_reset_dev(acx_device_t * adev); -STATick int acxpci_verify_init(acx_device_t * adev); +//= STATick int acxpci_verify_init(acx_device_t * adev); STATick void acxpci_reset_mac(acx_device_t * adev); STATick void acxpci_up(struct ieee80211_hw *hw); -- 1.7.8.1 |