diff options
Diffstat (limited to 'drivers/net/wireless/libertas/main.c')
-rw-r--r-- | drivers/net/wireless/libertas/main.c | 182 |
1 files changed, 0 insertions, 182 deletions
diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c index 2f87659cc1d3..ee0893334553 100644 --- a/drivers/net/wireless/libertas/main.c +++ b/drivers/net/wireless/libertas/main.c | |||
@@ -45,119 +45,6 @@ module_param_named(libertas_debug, lbs_debug, int, 0644); | |||
45 | struct cmd_confirm_sleep confirm_sleep; | 45 | struct cmd_confirm_sleep confirm_sleep; |
46 | 46 | ||
47 | 47 | ||
48 | #define LBS_TX_PWR_DEFAULT 20 /*100mW */ | ||
49 | #define LBS_TX_PWR_US_DEFAULT 20 /*100mW */ | ||
50 | #define LBS_TX_PWR_JP_DEFAULT 16 /*50mW */ | ||
51 | #define LBS_TX_PWR_FR_DEFAULT 20 /*100mW */ | ||
52 | #define LBS_TX_PWR_EMEA_DEFAULT 20 /*100mW */ | ||
53 | |||
54 | /* Format { channel, frequency (MHz), maxtxpower } */ | ||
55 | /* band: 'B/G', region: USA FCC/Canada IC */ | ||
56 | static struct chan_freq_power channel_freq_power_US_BG[] = { | ||
57 | {1, 2412, LBS_TX_PWR_US_DEFAULT}, | ||
58 | {2, 2417, LBS_TX_PWR_US_DEFAULT}, | ||
59 | {3, 2422, LBS_TX_PWR_US_DEFAULT}, | ||
60 | {4, 2427, LBS_TX_PWR_US_DEFAULT}, | ||
61 | {5, 2432, LBS_TX_PWR_US_DEFAULT}, | ||
62 | {6, 2437, LBS_TX_PWR_US_DEFAULT}, | ||
63 | {7, 2442, LBS_TX_PWR_US_DEFAULT}, | ||
64 | {8, 2447, LBS_TX_PWR_US_DEFAULT}, | ||
65 | {9, 2452, LBS_TX_PWR_US_DEFAULT}, | ||
66 | {10, 2457, LBS_TX_PWR_US_DEFAULT}, | ||
67 | {11, 2462, LBS_TX_PWR_US_DEFAULT} | ||
68 | }; | ||
69 | |||
70 | /* band: 'B/G', region: Europe ETSI */ | ||
71 | static struct chan_freq_power channel_freq_power_EU_BG[] = { | ||
72 | {1, 2412, LBS_TX_PWR_EMEA_DEFAULT}, | ||
73 | {2, 2417, LBS_TX_PWR_EMEA_DEFAULT}, | ||
74 | {3, 2422, LBS_TX_PWR_EMEA_DEFAULT}, | ||
75 | {4, 2427, LBS_TX_PWR_EMEA_DEFAULT}, | ||
76 | {5, 2432, LBS_TX_PWR_EMEA_DEFAULT}, | ||
77 | {6, 2437, LBS_TX_PWR_EMEA_DEFAULT}, | ||
78 | {7, 2442, LBS_TX_PWR_EMEA_DEFAULT}, | ||
79 | {8, 2447, LBS_TX_PWR_EMEA_DEFAULT}, | ||
80 | {9, 2452, LBS_TX_PWR_EMEA_DEFAULT}, | ||
81 | {10, 2457, LBS_TX_PWR_EMEA_DEFAULT}, | ||
82 | {11, 2462, LBS_TX_PWR_EMEA_DEFAULT}, | ||
83 | {12, 2467, LBS_TX_PWR_EMEA_DEFAULT}, | ||
84 | {13, 2472, LBS_TX_PWR_EMEA_DEFAULT} | ||
85 | }; | ||
86 | |||
87 | /* band: 'B/G', region: Spain */ | ||
88 | static struct chan_freq_power channel_freq_power_SPN_BG[] = { | ||
89 | {10, 2457, LBS_TX_PWR_DEFAULT}, | ||
90 | {11, 2462, LBS_TX_PWR_DEFAULT} | ||
91 | }; | ||
92 | |||
93 | /* band: 'B/G', region: France */ | ||
94 | static struct chan_freq_power channel_freq_power_FR_BG[] = { | ||
95 | {10, 2457, LBS_TX_PWR_FR_DEFAULT}, | ||
96 | {11, 2462, LBS_TX_PWR_FR_DEFAULT}, | ||
97 | {12, 2467, LBS_TX_PWR_FR_DEFAULT}, | ||
98 | {13, 2472, LBS_TX_PWR_FR_DEFAULT} | ||
99 | }; | ||
100 | |||
101 | /* band: 'B/G', region: Japan */ | ||
102 | static struct chan_freq_power channel_freq_power_JPN_BG[] = { | ||
103 | {1, 2412, LBS_TX_PWR_JP_DEFAULT}, | ||
104 | {2, 2417, LBS_TX_PWR_JP_DEFAULT}, | ||
105 | {3, 2422, LBS_TX_PWR_JP_DEFAULT}, | ||
106 | {4, 2427, LBS_TX_PWR_JP_DEFAULT}, | ||
107 | {5, 2432, LBS_TX_PWR_JP_DEFAULT}, | ||
108 | {6, 2437, LBS_TX_PWR_JP_DEFAULT}, | ||
109 | {7, 2442, LBS_TX_PWR_JP_DEFAULT}, | ||
110 | {8, 2447, LBS_TX_PWR_JP_DEFAULT}, | ||
111 | {9, 2452, LBS_TX_PWR_JP_DEFAULT}, | ||
112 | {10, 2457, LBS_TX_PWR_JP_DEFAULT}, | ||
113 | {11, 2462, LBS_TX_PWR_JP_DEFAULT}, | ||
114 | {12, 2467, LBS_TX_PWR_JP_DEFAULT}, | ||
115 | {13, 2472, LBS_TX_PWR_JP_DEFAULT}, | ||
116 | {14, 2484, LBS_TX_PWR_JP_DEFAULT} | ||
117 | }; | ||
118 | |||
119 | /** | ||
120 | * the structure for channel, frequency and power | ||
121 | */ | ||
122 | struct region_cfp_table { | ||
123 | u8 region; | ||
124 | struct chan_freq_power *cfp_BG; | ||
125 | int cfp_no_BG; | ||
126 | }; | ||
127 | |||
128 | /** | ||
129 | * the structure for the mapping between region and CFP | ||
130 | */ | ||
131 | static struct region_cfp_table region_cfp_table[] = { | ||
132 | {0x10, /*US FCC */ | ||
133 | channel_freq_power_US_BG, | ||
134 | ARRAY_SIZE(channel_freq_power_US_BG), | ||
135 | } | ||
136 | , | ||
137 | {0x20, /*CANADA IC */ | ||
138 | channel_freq_power_US_BG, | ||
139 | ARRAY_SIZE(channel_freq_power_US_BG), | ||
140 | } | ||
141 | , | ||
142 | {0x30, /*EU*/ channel_freq_power_EU_BG, | ||
143 | ARRAY_SIZE(channel_freq_power_EU_BG), | ||
144 | } | ||
145 | , | ||
146 | {0x31, /*SPAIN*/ channel_freq_power_SPN_BG, | ||
147 | ARRAY_SIZE(channel_freq_power_SPN_BG), | ||
148 | } | ||
149 | , | ||
150 | {0x32, /*FRANCE*/ channel_freq_power_FR_BG, | ||
151 | ARRAY_SIZE(channel_freq_power_FR_BG), | ||
152 | } | ||
153 | , | ||
154 | {0x40, /*JAPAN*/ channel_freq_power_JPN_BG, | ||
155 | ARRAY_SIZE(channel_freq_power_JPN_BG), | ||
156 | } | ||
157 | , | ||
158 | /*Add new region here */ | ||
159 | }; | ||
160 | |||
161 | /** | 48 | /** |
162 | * the table to keep region code | 49 | * the table to keep region code |
163 | */ | 50 | */ |
@@ -165,13 +52,6 @@ u16 lbs_region_code_to_index[MRVDRV_MAX_REGION_CODE] = | |||
165 | { 0x10, 0x20, 0x30, 0x31, 0x32, 0x40 }; | 52 | { 0x10, 0x20, 0x30, 0x31, 0x32, 0x40 }; |
166 | 53 | ||
167 | /** | 54 | /** |
168 | * 802.11b/g supported bitrates (in 500Kb/s units) | ||
169 | */ | ||
170 | u8 lbs_bg_rates[MAX_RATES] = | ||
171 | { 0x02, 0x04, 0x0b, 0x16, 0x0c, 0x12, 0x18, 0x24, 0x30, 0x48, 0x60, 0x6c, | ||
172 | 0x00, 0x00 }; | ||
173 | |||
174 | /** | ||
175 | * FW rate table. FW refers to rates by their index in this table, not by the | 55 | * FW rate table. FW refers to rates by their index in this table, not by the |
176 | * rate value itself. Values of 0x00 are | 56 | * rate value itself. Values of 0x00 are |
177 | * reserved positions. | 57 | * reserved positions. |
@@ -1617,68 +1497,6 @@ static void lbs_remove_mesh(struct lbs_private *priv) | |||
1617 | lbs_deb_leave(LBS_DEB_MESH); | 1497 | lbs_deb_leave(LBS_DEB_MESH); |
1618 | } | 1498 | } |
1619 | 1499 | ||
1620 | /** | ||
1621 | * @brief This function finds the CFP in | ||
1622 | * region_cfp_table based on region and band parameter. | ||
1623 | * | ||
1624 | * @param region The region code | ||
1625 | * @param band The band | ||
1626 | * @param cfp_no A pointer to CFP number | ||
1627 | * @return A pointer to CFP | ||
1628 | */ | ||
1629 | struct chan_freq_power *lbs_get_region_cfp_table(u8 region, int *cfp_no) | ||
1630 | { | ||
1631 | int i, end; | ||
1632 | |||
1633 | lbs_deb_enter(LBS_DEB_MAIN); | ||
1634 | |||
1635 | end = ARRAY_SIZE(region_cfp_table); | ||
1636 | |||
1637 | for (i = 0; i < end ; i++) { | ||
1638 | lbs_deb_main("region_cfp_table[i].region=%d\n", | ||
1639 | region_cfp_table[i].region); | ||
1640 | if (region_cfp_table[i].region == region) { | ||
1641 | *cfp_no = region_cfp_table[i].cfp_no_BG; | ||
1642 | lbs_deb_leave(LBS_DEB_MAIN); | ||
1643 | return region_cfp_table[i].cfp_BG; | ||
1644 | } | ||
1645 | } | ||
1646 | |||
1647 | lbs_deb_leave_args(LBS_DEB_MAIN, "ret NULL"); | ||
1648 | return NULL; | ||
1649 | } | ||
1650 | |||
1651 | int lbs_set_regiontable(struct lbs_private *priv, u8 region, u8 band) | ||
1652 | { | ||
1653 | int ret = 0; | ||
1654 | int i = 0; | ||
1655 | |||
1656 | struct chan_freq_power *cfp; | ||
1657 | int cfp_no; | ||
1658 | |||
1659 | lbs_deb_enter(LBS_DEB_MAIN); | ||
1660 | |||
1661 | memset(priv->region_channel, 0, sizeof(priv->region_channel)); | ||
1662 | |||
1663 | cfp = lbs_get_region_cfp_table(region, &cfp_no); | ||
1664 | if (cfp != NULL) { | ||
1665 | priv->region_channel[i].nrcfp = cfp_no; | ||
1666 | priv->region_channel[i].CFP = cfp; | ||
1667 | } else { | ||
1668 | lbs_deb_main("wrong region code %#x in band B/G\n", | ||
1669 | region); | ||
1670 | ret = -1; | ||
1671 | goto out; | ||
1672 | } | ||
1673 | priv->region_channel[i].valid = 1; | ||
1674 | priv->region_channel[i].region = region; | ||
1675 | priv->region_channel[i].band = band; | ||
1676 | i++; | ||
1677 | out: | ||
1678 | lbs_deb_leave_args(LBS_DEB_MAIN, "ret %d", ret); | ||
1679 | return ret; | ||
1680 | } | ||
1681 | |||
1682 | void lbs_queue_event(struct lbs_private *priv, u32 event) | 1500 | void lbs_queue_event(struct lbs_private *priv, u32 event) |
1683 | { | 1501 | { |
1684 | unsigned long flags; | 1502 | unsigned long flags; |