ath9k: make endian check optional
[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 .endian_check = true,
23 };
24
25 static int
26 ath5k_pci_plat_dev_init(struct pci_dev *dev)
27 {
28 dev->dev.platform_data = &ath5k_pdata;
29 return 0;
30 }
31
32 static int
33 ath9k_pci_plat_dev_init(struct pci_dev *dev)
34 {
35 dev->dev.platform_data = &ath9k_pdata;
36 return 0;
37 }
38
39 void __init
40 ltq_register_ath5k(u16 *eeprom_data, u8 *macaddr)
41 {
42 ath5k_pdata.eeprom_data = eeprom_data;
43 ath5k_pdata.macaddr = macaddr;
44 ltqpci_plat_dev_init = ath5k_pci_plat_dev_init;
45 }
46
47 void __init
48 ltq_register_ath9k(u16 *eeprom_data, u8 *macaddr)
49 {
50 memcpy(ath9k_pdata.eeprom_data, eeprom_data, sizeof(ath9k_pdata.eeprom_data));
51 ath9k_pdata.macaddr = macaddr;
52 ltqpci_plat_dev_init = ath9k_pci_plat_dev_init;
53 }