cnss2: Add api to return the pci slot in use
Add api to return the pci slot in use. With the new targets, QCA6490/kiwi devices are getting attached on pci slot 1 as well, so host driver call this exported api to get the pci slot of device attached. Change-Id: Ief51204258090df16b48267f3aeb851ded365525
Этот коммит содержится в:
21
cnss2/pci.c
21
cnss2/pci.c
@@ -1655,6 +1655,27 @@ void cnss_pci_unlock_reg_window(struct device *dev, unsigned long *flags)
|
||||
}
|
||||
EXPORT_SYMBOL(cnss_pci_unlock_reg_window);
|
||||
|
||||
int cnss_get_pci_slot(struct device *dev)
|
||||
{
|
||||
struct pci_dev *pci_dev = to_pci_dev(dev);
|
||||
struct cnss_pci_data *pci_priv = cnss_get_pci_priv(pci_dev);
|
||||
struct cnss_plat_data *plat_priv = NULL;
|
||||
|
||||
if (!pci_priv) {
|
||||
cnss_pr_err("pci_priv is NULL\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
plat_priv = pci_priv->plat_priv;
|
||||
if (!plat_priv) {
|
||||
cnss_pr_err("plat_priv is NULL\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
return plat_priv->rc_num;
|
||||
}
|
||||
EXPORT_SYMBOL(cnss_get_pci_slot);
|
||||
|
||||
/**
|
||||
* cnss_pci_dump_bl_sram_mem - Dump WLAN device bootloader debug log
|
||||
* @pci_priv: driver PCI bus context pointer
|
||||
|
@@ -275,4 +275,5 @@ extern int cnss_get_mem_seg_count(enum cnss_remote_mem_type type, u32 *seg);
|
||||
extern int cnss_get_mem_segment_info(enum cnss_remote_mem_type type,
|
||||
struct cnss_mem_segment segment[],
|
||||
u32 segment_count);
|
||||
extern int cnss_get_pci_slot(struct device *dev);
|
||||
#endif /* _NET_CNSS2_H */
|
||||
|
Ссылка в новой задаче
Block a user