++#ifdef CONFIG_RT2800PCI_WISOC
++
++#ifdef CONFIG_RALINK_RT288X
++#define WSOC_RT_CHIPSET RT2880
++#endif /* CONFIG_RALINK_RT288X */
++
++#ifdef CONFIG_RALINK_RT305X
++#define WSOC_RT_CHIPSET RT3052
++#endif /* CONFIG_RALINK_RT305X */
++
++static void rt2800soc_free_reg(struct rt2x00_dev *rt2x00dev)
++{
++ kfree(rt2x00dev->rf);
++ rt2x00dev->rf = NULL;
++
++ kfree(rt2x00dev->eeprom);
++ rt2x00dev->eeprom = NULL;
++}
++
++static int rt2800soc_alloc_reg(struct rt2x00_dev *rt2x00dev)
++{
++ struct platform_device *pdev = to_platform_device(rt2x00dev->dev);
++ struct resource *res;
++
++ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
++ if (!res) {
++ ERROR_PROBE("Failed to get MMIO resource\n");
++ return -ENODEV;
++ }
++
++ rt2x00dev->csr.base = (void __iomem *) KSEG1ADDR(res->start);
++ rt2x00dev->eeprom = kzalloc(rt2x00dev->ops->eeprom_size, GFP_KERNEL);
++ if (!rt2x00dev->eeprom)
++ goto exit;
++
++ rt2x00dev->rf = kzalloc(rt2x00dev->ops->rf_size, GFP_KERNEL);
++ if (!rt2x00dev->rf)
++ goto exit;
++
++ return 0;
++
++exit:
++ ERROR_PROBE("Failed to allocate registers.\n");
++ rt2800soc_free_reg(rt2x00dev);
++
++ return -ENOMEM;
++}
++
++static int rt2800soc_probe(struct platform_device *pdev)
++{
++ const struct rt2x00_ops *ops = &rt2800pci_ops;
++ struct ieee80211_hw *hw;
++ struct rt2x00_dev *rt2x00dev;
++ int retval;
++
++ hw = ieee80211_alloc_hw(sizeof(struct rt2x00_dev), ops->hw);
++ if (!hw) {
++ ERROR_PROBE("Failed to allocate hardware.\n");
++ return -ENOMEM;
++ }
++
++ platform_set_drvdata(pdev, hw);
++
++ rt2x00dev = hw->priv;
++ rt2x00dev->dev = &pdev->dev;
++ rt2x00dev->ops = ops;
++ rt2x00dev->hw = hw;
++ rt2x00dev->irq = platform_get_irq(pdev, 0);
++ rt2x00dev->name = pdev->dev.driver->name;
++
++ rt2x00_set_chip_rt(rt2x00dev, WSOC_RT_CHIPSET);
++
++ retval = rt2800soc_alloc_reg(rt2x00dev);
++ if (retval)
++ goto exit_free_device;
++
++ retval = rt2x00lib_probe_dev(rt2x00dev);
++ if (retval)
++ goto exit_free_reg;
++
++ return 0;
++
++exit_free_reg:
++ rt2800soc_free_reg(rt2x00dev);
++
++exit_free_device:
++ ieee80211_free_hw(hw);
++
++ return retval;
++}
++
++static int rt2800soc_remove(struct platform_device *pdev)
++{
++ struct ieee80211_hw *hw = platform_get_drvdata(pdev);
++ struct rt2x00_dev *rt2x00dev = hw->priv;
++
++ /*
++ * Free all allocated data.
++ */
++ rt2x00lib_remove_dev(rt2x00dev);
++ rt2800soc_free_reg(rt2x00dev);
++ ieee80211_free_hw(hw);
++
++ return 0;
++}
++
++static struct platform_driver rt2800soc_driver = {
++ .driver.name = "rt2800_wmac",
++ .probe = rt2800soc_probe,
++ .remove = rt2800soc_remove,
++};
++#endif /* CONFIG_RT2800PCI_WISOC */
++
++#ifdef CONFIG_RT2800PCI_PCI