brcmsmac: remove pcicore_find_pci_capability()
authorHauke Mehrtens <hauke@hauke-m.de>
Sun, 29 Apr 2012 00:50:37 +0000 (02:50 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 16 May 2012 16:45:25 +0000 (12:45 -0400)
This function is now unreferenced

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Tested-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/brcm80211/brcmsmac/nicpci.c
drivers/net/wireless/brcm80211/brcmsmac/nicpci.h

index 5de506d4ac718428024f4c9726a3f507b70a202d..2d615cbcd90317d87fc2a080ea1b5219a10e24e7 100644 (file)
@@ -240,70 +240,6 @@ void pcicore_deinit(struct pcicore_info *pch)
        kfree(pch);
 }
 
-/* return cap_offset if requested capability exists in the PCI config space */
-/* Note that it's caller's responsibility to make sure it's a pci bus */
-u8
-pcicore_find_pci_capability(struct pci_dev *dev, u8 req_cap_id,
-                           unsigned char *buf, u32 *buflen)
-{
-       u8 cap_id;
-       u8 cap_ptr = 0;
-       u32 bufsize;
-       u8 byte_val;
-
-       /* check for Header type 0 */
-       pci_read_config_byte(dev, PCI_HEADER_TYPE, &byte_val);
-       if ((byte_val & 0x7f) != PCI_HEADER_TYPE_NORMAL)
-               goto end;
-
-       /* check if the capability pointer field exists */
-       pci_read_config_byte(dev, PCI_STATUS, &byte_val);
-       if (!(byte_val & PCI_STATUS_CAP_LIST))
-               goto end;
-
-       pci_read_config_byte(dev, PCI_CAPABILITY_LIST, &cap_ptr);
-       /* check if the capability pointer is 0x00 */
-       if (cap_ptr == 0x00)
-               goto end;
-
-       /* loop thru the capability list
-        * and see if the pcie capability exists
-        */
-
-       pci_read_config_byte(dev, cap_ptr, &cap_id);
-
-       while (cap_id != req_cap_id) {
-               pci_read_config_byte(dev, cap_ptr + 1, &cap_ptr);
-               if (cap_ptr == 0x00)
-                       break;
-               pci_read_config_byte(dev, cap_ptr, &cap_id);
-       }
-       if (cap_id != req_cap_id)
-               goto end;
-
-       /* found the caller requested capability */
-       if (buf != NULL && buflen != NULL) {
-               u8 cap_data;
-
-               bufsize = *buflen;
-               if (!bufsize)
-                       goto end;
-               *buflen = 0;
-               /* copy the capability data excluding cap ID and next ptr */
-               cap_data = cap_ptr + 2;
-               if ((bufsize + cap_data) > PCI_SZPCR)
-                       bufsize = PCI_SZPCR - cap_data;
-               *buflen = bufsize;
-               while (bufsize--) {
-                       pci_read_config_byte(dev, cap_data, buf);
-                       cap_data++;
-                       buf++;
-               }
-       }
-end:
-       return cap_ptr;
-}
-
 /* ***** Register Access API */
 static uint
 pcie_readreg(struct bcma_device *core, uint addrtype, uint offset)
index 460a33e4893d615ca8375cff5eb3fe02e5a2d31d..1e15ba988cba897c623f6156652feab02b4c0889 100644 (file)
@@ -66,8 +66,6 @@ extern struct pcicore_info *pcicore_init(struct si_pub *sih,
 extern void pcicore_deinit(struct pcicore_info *pch);
 extern void pcicore_up(struct pcicore_info *pch, int state);
 extern void pcicore_down(struct pcicore_info *pch, int state);
-extern u8 pcicore_find_pci_capability(struct pci_dev *dev, u8 req_cap_id,
-                                     unsigned char *buf, u32 *buflen);
 extern void pcicore_fixcfg(struct pcicore_info *pch);
 
 #endif /* _BRCM_NICPCI_H_ */