]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[rtl818x] Obviate RTL_ROM() hack
authorMichael Brown <mcb30@ipxe.org>
Wed, 22 Apr 2015 10:05:19 +0000 (11:05 +0100)
committerMichael Brown <mcb30@ipxe.org>
Wed, 22 Apr 2015 10:05:19 +0000 (11:05 +0100)
Reported-by: Robin Smidsrød <robin@smidsrod.no>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/drivers/net/rtl818x/rtl8180.c
src/drivers/net/rtl818x/rtl8185.c
src/drivers/net/rtl818x/rtl818x.c
src/drivers/net/rtl818x/rtl818x.h

index 0c7d0775f6894ff1ca20871dfa22a62dfae35f34..5f97480fa6c1bce450127afa91ab872a3041f9a4 100644 (file)
@@ -3,16 +3,23 @@
 FILE_LICENCE(GPL2_OR_LATER);
 
 #include <ipxe/pci.h>
+#include "rtl818x.h"
 
-PROVIDE_REQUIRING_SYMBOL();
-REQUIRE_OBJECT(rtl818x);
-REQUIRE_OBJECT(rtl8180_grf5101);
-REQUIRE_OBJECT(rtl8180_max2820);
-REQUIRE_OBJECT(rtl8180_sa2400);
-
-static struct pci_device_id rtl8180_nics[] __unused = {
+static struct pci_device_id rtl8180_nics[] = {
        PCI_ROM(0x10ec, 0x8180, "rtl8180", "Realtek 8180", 0),
        PCI_ROM(0x1799, 0x6001, "f5d6001", "Belkin F5D6001", 0),
        PCI_ROM(0x1799, 0x6020, "f5d6020", "Belkin F5D6020", 0),
        PCI_ROM(0x1186, 0x3300, "dwl510",  "D-Link DWL-510", 0),
 };
+
+struct pci_driver rtl8180_driver __pci_driver = {
+       .ids            = rtl8180_nics,
+       .id_count       = sizeof(rtl8180_nics) / sizeof(rtl8180_nics[0]),
+       .probe          = rtl818x_probe,
+       .remove         = rtl818x_remove,
+};
+
+REQUIRING_SYMBOL(rtl8180_driver);
+REQUIRE_OBJECT(rtl8180_grf5101);
+REQUIRE_OBJECT(rtl8180_max2820);
+REQUIRE_OBJECT(rtl8180_sa2400);
index 438c5f24bc097c16c1b82899a149b0696f3d86b5..234978cea56868f7feeff6ace419ed5c4c21476e 100644 (file)
@@ -3,13 +3,20 @@
 FILE_LICENCE(GPL2_OR_LATER);
 
 #include <ipxe/pci.h>
-
-PROVIDE_REQUIRING_SYMBOL();
-REQUIRE_OBJECT(rtl818x);
-REQUIRE_OBJECT(rtl8185_rtl8225);
+#include "rtl818x.h"
 
 static struct pci_device_id rtl8185_nics[] __unused = {
        PCI_ROM(0x10ec, 0x8185, "rtl8185", "Realtek 8185", 0),
        PCI_ROM(0x1799, 0x700f, "f5d7000", "Belkin F5D7000", 0),
        PCI_ROM(0x1799, 0x701f, "f5d7010", "Belkin F5D7010", 0),
 };
+
+struct pci_driver rtl8185_driver __pci_driver = {
+       .ids            = rtl8185_nics,
+       .id_count       = sizeof(rtl8185_nics) / sizeof(rtl8185_nics[0]),
+       .probe          = rtl818x_probe,
+       .remove         = rtl818x_remove,
+};
+
+REQUIRING_SYMBOL(rtl8185_driver);
+REQUIRE_OBJECT(rtl8185_rtl8225);
index cf4c7556f637bcca9d1367230ab632433c7a0434..8b3c206d46b5eb7f0f49dc3a111c3becf535e58d 100644 (file)
@@ -649,7 +649,7 @@ struct net80211_device_operations rtl818x_operations = {
        .config = rtl818x_config,
 };
 
-static int rtl818x_probe(struct pci_device *pdev )
+int rtl818x_probe(struct pci_device *pdev )
 {
        struct net80211_device *dev;
        struct rtl818x_priv *priv;
@@ -820,7 +820,7 @@ static int rtl818x_probe(struct pci_device *pdev )
        return err;
 }
 
-static void rtl818x_remove(struct pci_device *pdev)
+void rtl818x_remove(struct pci_device *pdev)
 {
        struct net80211_device *dev = pci_get_drvdata(pdev);
 
@@ -830,25 +830,3 @@ static void rtl818x_remove(struct pci_device *pdev)
        net80211_unregister(dev);
        net80211_free(dev);
 }
-
-/* Hide PCI_ROM definitions in here from parserom.pl; the definitions
-   that should be used are in rtl8180.c and rtl8185.c. */
-#define RTL_ROM PCI_ROM
-
-static struct pci_device_id rtl818x_nics[] = {
-       RTL_ROM(0x10ec, 0x8185, "rtl8185", "Realtek 8185", 0),
-       RTL_ROM(0x1799, 0x700f, "f5d7000", "Belkin F5D7000", 0),
-       RTL_ROM(0x1799, 0x701f, "f5d7010", "Belkin F5D7010", 0),
-
-       RTL_ROM(0x10ec, 0x8180, "rtl8180", "Realtek 8180", 0),
-       RTL_ROM(0x1799, 0x6001, "f5d6001", "Belkin F5D6001", 0),
-       RTL_ROM(0x1799, 0x6020, "f5d6020", "Belkin F5D6020", 0),
-       RTL_ROM(0x1186, 0x3300, "dwl510",  "D-Link DWL-510", 0),
-};
-
-struct pci_driver rtl818x_driver __pci_driver = {
-       .ids            = rtl818x_nics,
-       .id_count       = sizeof(rtl818x_nics) / sizeof(rtl818x_nics[0]),
-       .probe          = rtl818x_probe,
-       .remove         = rtl818x_remove,
-};
index 4e57d0bd391023268941e0f98fa1f04196e4700c..ae4b8a96f046f6858c07b0e3e89b7835261f378f 100644 (file)
@@ -19,6 +19,7 @@
 
 #include <ipxe/spi_bit.h>
 #include <ipxe/tables.h>
+#include <ipxe/net80211.h>
 
 FILE_LICENCE(GPL2_ONLY);
 
@@ -356,4 +357,7 @@ struct rtl818x_rf_ops {
        void (*conf_erp)(struct net80211_device *dev); /* set based on dev->erp_flags */
 };
 
+extern int rtl818x_probe(struct pci_device *pdev );
+extern void rtl818x_remove(struct pci_device *pdev);
+
 #endif /* RTL818X_H */