Get this information from the transport layer.
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
/**
* struct iwl_bus_ops - bus specific operations
- * @get_hw_id_string: prints the hw_id in the provided buffer
* @get_hw_id: get hw_id in u32
*/
struct iwl_bus_ops {
- void (*get_hw_id_string)(struct iwl_bus *bus, char buf[], int buf_len);
u32 (*get_hw_id)(struct iwl_bus *bus);
};
char bus_specific[0] __attribute__((__aligned__(sizeof(void *))));
};
-static inline void bus_get_hw_id_string(struct iwl_bus *bus, char buf[],
- int buf_len)
-{
- bus->ops->get_hw_id_string(bus, buf, buf_len);
-}
-
static inline u32 bus_get_hw_id(struct iwl_bus *bus)
{
return bus->ops->get_hw_id(bus);
if ((priv->bands[IEEE80211_BAND_5GHZ].n_channels == 0) &&
cfg(priv)->sku & EEPROM_SKU_CAP_BAND_52GHZ) {
- char buf[32];
- bus_get_hw_id_string(bus(priv), buf, sizeof(buf));
IWL_INFO(priv, "Incorrectly detected BG card as ABG. "
- "Please send your %s to maintainer.\n", buf);
+ "Please send your %s to maintainer.\n",
+ trans(priv)->hw_id_str);
cfg(priv)->sku &= ~EEPROM_SKU_CAP_BAND_52GHZ;
}
#define IWL_BUS_GET_PCI_DEV(_iwl_bus) \
((IWL_BUS_GET_PCI_BUS(_iwl_bus))->pci_dev)
-static void iwl_pci_get_hw_id_string(struct iwl_bus *bus, char buf[],
- int buf_len)
-{
- struct pci_dev *pci_dev = IWL_BUS_GET_PCI_DEV(bus);
-
- snprintf(buf, buf_len, "PCI ID: 0x%04X:0x%04X", pci_dev->device,
- pci_dev->subsystem_device);
-}
-
static u32 iwl_pci_get_hw_id(struct iwl_bus *bus)
{
struct pci_dev *pci_dev = IWL_BUS_GET_PCI_DEV(bus);
}
static const struct iwl_bus_ops bus_ops_pci = {
- .get_hw_id_string = iwl_pci_get_hw_id_string,
.get_hw_id = iwl_pci_get_hw_id,
};
trans->dev = &pdev->dev;
trans->irq = pdev->irq;
trans_pcie->pci_dev = pdev;
+ snprintf(trans->hw_id_str, sizeof(trans->hw_id_str),
+ "PCI ID: 0x%04X:0x%04X", pdev->device, pdev->subsystem_device);
/* TODO: Move this away, not needed if not MSI */
/* enable rfkill interrupt: hw bug w/a */
* @reg_lock - protect hw register access
* @dev - pointer to struct device * that represents the device
* @irq - the irq number for the device
+ * @hw_id_str: a string with info about HW ID. Set during transport allocation.
* @ucode_write_complete: indicates that the ucode has been copied.
* @ucode_rt: run time ucode image
* @ucode_init: init ucode image
struct device *dev;
unsigned int irq;
+ char hw_id_str[52];
u8 ucode_write_complete; /* the image write is complete */
struct fw_img ucode_rt;