common.c (1cbc99dfe5d7d686fd022647f4e489b5eb8e9068) common.c (7705ba6f7badb8cf38a0a19dad71e11a77ecb9cd)
1/*
2 * Copyright (c) 2010 Broadcom Corporation
3 *
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES

--- 24 unchanged lines hidden (view full) ---

33MODULE_DESCRIPTION("Broadcom 802.11 wireless LAN fullmac driver.");
34MODULE_LICENSE("Dual BSD/GPL");
35
36const u8 ALLFFMAC[ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
37
38#define BRCMF_DEFAULT_SCAN_CHANNEL_TIME 40
39#define BRCMF_DEFAULT_SCAN_UNASSOC_TIME 40
40
1/*
2 * Copyright (c) 2010 Broadcom Corporation
3 *
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES

--- 24 unchanged lines hidden (view full) ---

33MODULE_DESCRIPTION("Broadcom 802.11 wireless LAN fullmac driver.");
34MODULE_LICENSE("Dual BSD/GPL");
35
36const u8 ALLFFMAC[ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
37
38#define BRCMF_DEFAULT_SCAN_CHANNEL_TIME 40
39#define BRCMF_DEFAULT_SCAN_UNASSOC_TIME 40
40
41/* boost value for RSSI_DELTA in preferred join selection */
41/* default boost value for RSSI_DELTA in preferred join selection */
42#define BRCMF_JOIN_PREF_RSSI_BOOST 8
43
44#define BRCMF_DEFAULT_TXGLOM_SIZE 32 /* max tx frames in glom chain */
45
46static int brcmf_sdiod_txglomsz = BRCMF_DEFAULT_TXGLOM_SIZE;
47module_param_named(txglomsz, brcmf_sdiod_txglomsz, int, 0);
48MODULE_PARM_DESC(txglomsz, "Maximum tx packet chain size [SDIO]");
49

--- 28 unchanged lines hidden (view full) ---

78static int brcmf_ignore_probe_fail;
79module_param_named(ignore_probe_fail, brcmf_ignore_probe_fail, int, 0);
80MODULE_PARM_DESC(ignore_probe_fail, "always succeed probe for debugging");
81#endif
82
83static struct brcmfmac_platform_data *brcmfmac_pdata;
84struct brcmf_mp_global_t brcmf_mp_global;
85
42#define BRCMF_JOIN_PREF_RSSI_BOOST 8
43
44#define BRCMF_DEFAULT_TXGLOM_SIZE 32 /* max tx frames in glom chain */
45
46static int brcmf_sdiod_txglomsz = BRCMF_DEFAULT_TXGLOM_SIZE;
47module_param_named(txglomsz, brcmf_sdiod_txglomsz, int, 0);
48MODULE_PARM_DESC(txglomsz, "Maximum tx packet chain size [SDIO]");
49

--- 28 unchanged lines hidden (view full) ---

78static int brcmf_ignore_probe_fail;
79module_param_named(ignore_probe_fail, brcmf_ignore_probe_fail, int, 0);
80MODULE_PARM_DESC(ignore_probe_fail, "always succeed probe for debugging");
81#endif
82
83static struct brcmfmac_platform_data *brcmfmac_pdata;
84struct brcmf_mp_global_t brcmf_mp_global;
85
86void brcmf_c_set_joinpref_default(struct brcmf_if *ifp)
87{
88 struct brcmf_join_pref_params join_pref_params[2];
89 int err;
90
91 /* Setup join_pref to select target by RSSI (boost on 5GHz) */
92 join_pref_params[0].type = BRCMF_JOIN_PREF_RSSI_DELTA;
93 join_pref_params[0].len = 2;
94 join_pref_params[0].rssi_gain = BRCMF_JOIN_PREF_RSSI_BOOST;
95 join_pref_params[0].band = WLC_BAND_5G;
96
97 join_pref_params[1].type = BRCMF_JOIN_PREF_RSSI;
98 join_pref_params[1].len = 2;
99 join_pref_params[1].rssi_gain = 0;
100 join_pref_params[1].band = 0;
101 err = brcmf_fil_iovar_data_set(ifp, "join_pref", join_pref_params,
102 sizeof(join_pref_params));
103 if (err)
104 brcmf_err("Set join_pref error (%d)\n", err);
105}
106
86int brcmf_c_preinit_dcmds(struct brcmf_if *ifp)
87{
88 s8 eventmask[BRCMF_EVENTING_MASK_LEN];
89 u8 buf[BRCMF_DCMD_SMLEN];
107int brcmf_c_preinit_dcmds(struct brcmf_if *ifp)
108{
109 s8 eventmask[BRCMF_EVENTING_MASK_LEN];
110 u8 buf[BRCMF_DCMD_SMLEN];
90 struct brcmf_join_pref_params join_pref_params[2];
91 struct brcmf_rev_info_le revinfo;
92 struct brcmf_rev_info *ri;
93 char *ptr;
94 s32 err;
95
96 /* retreive mac address */
97 err = brcmf_fil_iovar_data_get(ifp, "cur_etheraddr", ifp->mac_addr,
98 sizeof(ifp->mac_addr));

--- 50 unchanged lines hidden (view full) ---

149
150 /* set mpc */
151 err = brcmf_fil_iovar_int_set(ifp, "mpc", 1);
152 if (err) {
153 brcmf_err("failed setting mpc\n");
154 goto done;
155 }
156
111 struct brcmf_rev_info_le revinfo;
112 struct brcmf_rev_info *ri;
113 char *ptr;
114 s32 err;
115
116 /* retreive mac address */
117 err = brcmf_fil_iovar_data_get(ifp, "cur_etheraddr", ifp->mac_addr,
118 sizeof(ifp->mac_addr));

--- 50 unchanged lines hidden (view full) ---

169
170 /* set mpc */
171 err = brcmf_fil_iovar_int_set(ifp, "mpc", 1);
172 if (err) {
173 brcmf_err("failed setting mpc\n");
174 goto done;
175 }
176
157 /* Setup join_pref to select target by RSSI(with boost on 5GHz) */
158 join_pref_params[0].type = BRCMF_JOIN_PREF_RSSI_DELTA;
159 join_pref_params[0].len = 2;
160 join_pref_params[0].rssi_gain = BRCMF_JOIN_PREF_RSSI_BOOST;
161 join_pref_params[0].band = WLC_BAND_5G;
162 join_pref_params[1].type = BRCMF_JOIN_PREF_RSSI;
163 join_pref_params[1].len = 2;
164 join_pref_params[1].rssi_gain = 0;
165 join_pref_params[1].band = 0;
166 err = brcmf_fil_iovar_data_set(ifp, "join_pref", join_pref_params,
167 sizeof(join_pref_params));
168 if (err)
169 brcmf_err("Set join_pref error (%d)\n", err);
177 brcmf_c_set_joinpref_default(ifp);
170
171 /* Setup event_msgs, enable E_IF */
172 err = brcmf_fil_iovar_data_get(ifp, "event_msgs", eventmask,
173 BRCMF_EVENTING_MASK_LEN);
174 if (err) {
175 brcmf_err("Get event_msgs error (%d)\n", err);
176 goto done;
177 }

--- 196 unchanged lines hidden ---
178
179 /* Setup event_msgs, enable E_IF */
180 err = brcmf_fil_iovar_data_get(ifp, "event_msgs", eventmask,
181 BRCMF_EVENTING_MASK_LEN);
182 if (err) {
183 brcmf_err("Get event_msgs error (%d)\n", err);
184 goto done;
185 }

--- 196 unchanged lines hidden ---