882cd8cf7024a1080ef465707bada11f745d7b0e
[openwrt/svn-archive/archive.git] / target / linux / lantiq / files-3.2 / arch / mips / lantiq / xway / dev-wifi-athxk.c
1 /*
2 * Copyright (C) 2011 John Crispin <blogic@openwrt.org>
3 * Copyright (C) 2011 Andrej Vlašić <andrej.vlasic0@gmail.com>
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 as published
7 * by the Free Software Foundation.
8 */
9
10 #include <linux/init.h>
11 #include <linux/platform_device.h>
12 #include <linux/ath5k_platform.h>
13 #include <linux/ath9k_platform.h>
14 #include <linux/pci.h>
15
16 #include "dev-wifi-athxk.h"
17
18 extern int (*ltqpci_plat_dev_init)(struct pci_dev *dev);
19 struct ath5k_platform_data ath5k_pdata;
20 struct ath9k_platform_data ath9k_pdata = {
21 .led_pin = -1,
22 };
23
24 static int
25 ath5k_pci_plat_dev_init(struct pci_dev *dev)
26 {
27 dev->dev.platform_data = &ath5k_pdata;
28 return 0;
29 }
30
31 static int
32 ath9k_pci_plat_dev_init(struct pci_dev *dev)
33 {
34 dev->dev.platform_data = &ath9k_pdata;
35 return 0;
36 }
37
38 void __init
39 ltq_register_ath5k(u16 *eeprom_data, u8 *macaddr)
40 {
41 ath5k_pdata.eeprom_data = eeprom_data;
42 ath5k_pdata.macaddr = macaddr;
43 ltqpci_plat_dev_init = ath5k_pci_plat_dev_init;
44 }
45
46 void __init
47 ltq_register_ath9k(u16 *eeprom_data, u8 *macaddr)
48 {
49 memcpy(ath9k_pdata.eeprom_data, eeprom_data, sizeof(ath9k_pdata.eeprom_data));
50 ath9k_pdata.macaddr = macaddr;
51 ltqpci_plat_dev_init = ath9k_pci_plat_dev_init;
52 }