Parcourir la source

qcacmn: Make hif_device_id an opaque type

If different busses cannot agree upon a common hif_device_id type,
we need to make it an opaque type in the general case and only
cast it in the bus specific code.

Change-Id: I769d65f10421caf07c8f5cc35ccfe11302485576
CRs-Fixed: 986480
Houston Hoffman il y a 9 ans
Parent
commit
f303f91734
2 fichiers modifiés avec 5 ajouts et 9 suppressions
  1. 2 7
      hif/inc/hif.h
  2. 3 2
      hif/src/pcie/if_pci.c

+ 2 - 7
hif/inc/hif.h

@@ -371,13 +371,8 @@ struct hif_msg_callbacks {
 #define HIF_DATA_ATTR_SET_ENABLE_11H(attr, v) \
 	(attr |= (v & 0x01) << 30)
 
-#ifdef HIF_PCI
-typedef struct pci_device_id hif_bus_id;
-#endif
-
-#ifdef HIF_SNOC
-typedef struct device hif_bus_id;
-#endif
+struct hif_bus_id;
+typedef struct hif_bus_id hif_bus_id;
 
 void hif_post_init(struct hif_opaque_softc *scn, void *hHTC,
 		   struct hif_msg_callbacks *callbacks);

+ 3 - 2
hif/src/pcie/if_pci.c

@@ -69,6 +69,7 @@
 #include "if_pci_internal.h"
 #include "icnss_stub.h"
 #include "ce_tasklet.h"
+#include "targaddrs.h"
 
 #include "pci_api.h"
 
@@ -3115,7 +3116,7 @@ QDF_STATUS hif_enable_bus(struct hif_softc *ol_sc,
 	uint32_t lcr_val;
 	int probe_again = 0;
 	struct pci_dev *pdev = bdev;
-	const struct pci_device_id *id = bid;
+	const struct pci_device_id *id = (const struct pci_device_id *)bid;
 	struct hif_target_info *tgt_info;
 
 	if (!ol_sc) {
@@ -3226,7 +3227,7 @@ int hif_get_target_type(struct hif_softc *ol_sc, struct device *dev,
 {
 	uint16_t revision_id;
 	struct pci_dev *pdev = bdev;
-	const struct pci_device_id *id = bid;
+	const struct pci_device_id *id = (const struct pci_device_id *)bid;
 
 	pci_read_config_word(pdev, 0x08, &revision_id);
 	return hif_get_device_type(id->device, revision_id,