Lines Matching refs:btci

149 static void brcmf_btcoex_boost_wifi(struct brcmf_btcoex_info *btci,  in brcmf_btcoex_boost_wifi()  argument
152 struct brcmf_if *ifp = btci->cfg->pub->iflist[0]; in brcmf_btcoex_boost_wifi()
154 if (trump_sco && !btci->saved_regs_part2) { in brcmf_btcoex_boost_wifi()
161 brcmf_btcoex_params_read(ifp, 50, &btci->reg50); in brcmf_btcoex_boost_wifi()
162 brcmf_btcoex_params_read(ifp, 51, &btci->reg51); in brcmf_btcoex_boost_wifi()
163 brcmf_btcoex_params_read(ifp, 64, &btci->reg64); in brcmf_btcoex_boost_wifi()
164 brcmf_btcoex_params_read(ifp, 65, &btci->reg65); in brcmf_btcoex_boost_wifi()
165 brcmf_btcoex_params_read(ifp, 71, &btci->reg71); in brcmf_btcoex_boost_wifi()
167 btci->saved_regs_part2 = true; in brcmf_btcoex_boost_wifi()
170 btci->reg50, btci->reg51, btci->reg64, in brcmf_btcoex_boost_wifi()
171 btci->reg65, btci->reg71); in brcmf_btcoex_boost_wifi()
180 } else if (btci->saved_regs_part2) { in brcmf_btcoex_boost_wifi()
183 brcmf_btcoex_params_write(ifp, 50, btci->reg50); in brcmf_btcoex_boost_wifi()
184 brcmf_btcoex_params_write(ifp, 51, btci->reg51); in brcmf_btcoex_boost_wifi()
185 brcmf_btcoex_params_write(ifp, 64, btci->reg64); in brcmf_btcoex_boost_wifi()
186 brcmf_btcoex_params_write(ifp, 65, btci->reg65); in brcmf_btcoex_boost_wifi()
187 brcmf_btcoex_params_write(ifp, 71, btci->reg71); in brcmf_btcoex_boost_wifi()
191 btci->reg50, btci->reg51, btci->reg64, in brcmf_btcoex_boost_wifi()
192 btci->reg65, btci->reg71); in brcmf_btcoex_boost_wifi()
194 btci->saved_regs_part2 = false; in brcmf_btcoex_boost_wifi()
243 static void btcmf_btcoex_save_part1(struct brcmf_btcoex_info *btci) in btcmf_btcoex_save_part1() argument
245 struct brcmf_if *ifp = btci->vif->ifp; in btcmf_btcoex_save_part1()
247 if (!btci->saved_regs_part1) { in btcmf_btcoex_save_part1()
249 brcmf_btcoex_params_read(ifp, 66, &btci->reg66); in btcmf_btcoex_save_part1()
250 brcmf_btcoex_params_read(ifp, 41, &btci->reg41); in btcmf_btcoex_save_part1()
251 brcmf_btcoex_params_read(ifp, 68, &btci->reg68); in btcmf_btcoex_save_part1()
252 btci->saved_regs_part1 = true; in btcmf_btcoex_save_part1()
255 btci->reg66, btci->reg41, in btcmf_btcoex_save_part1()
256 btci->reg68); in btcmf_btcoex_save_part1()
263 static void brcmf_btcoex_restore_part1(struct brcmf_btcoex_info *btci) in brcmf_btcoex_restore_part1() argument
267 if (btci->saved_regs_part1) { in brcmf_btcoex_restore_part1()
268 btci->saved_regs_part1 = false; in brcmf_btcoex_restore_part1()
269 ifp = btci->vif->ifp; in brcmf_btcoex_restore_part1()
270 brcmf_btcoex_params_write(ifp, 66, btci->reg66); in brcmf_btcoex_restore_part1()
271 brcmf_btcoex_params_write(ifp, 41, btci->reg41); in brcmf_btcoex_restore_part1()
272 brcmf_btcoex_params_write(ifp, 68, btci->reg68); in brcmf_btcoex_restore_part1()
275 btci->reg66, btci->reg41, in brcmf_btcoex_restore_part1()
276 btci->reg68); in brcmf_btcoex_restore_part1()
298 struct brcmf_btcoex_info *btci; in brcmf_btcoex_handler() local
299 btci = container_of(work, struct brcmf_btcoex_info, work); in brcmf_btcoex_handler()
300 if (btci->timer_on) { in brcmf_btcoex_handler()
301 btci->timer_on = false; in brcmf_btcoex_handler()
302 del_timer_sync(&btci->timer); in brcmf_btcoex_handler()
305 switch (btci->bt_state) { in brcmf_btcoex_handler()
311 btci->bt_state = BRCMF_BT_DHCP_OPPR_WIN; in brcmf_btcoex_handler()
312 if (btci->timeout < BRCMF_BTCOEX_OPPR_WIN_TIME) { in brcmf_btcoex_handler()
313 mod_timer(&btci->timer, btci->timer.expires); in brcmf_btcoex_handler()
315 btci->timeout -= BRCMF_BTCOEX_OPPR_WIN_TIME; in brcmf_btcoex_handler()
316 mod_timer(&btci->timer, in brcmf_btcoex_handler()
320 btci->timer_on = true; in brcmf_btcoex_handler()
324 if (btci->dhcp_done) { in brcmf_btcoex_handler()
332 brcmf_btcoex_boost_wifi(btci, true); in brcmf_btcoex_handler()
334 btci->bt_state = BRCMF_BT_DHCP_FLAG_FORCE_TIMEOUT; in brcmf_btcoex_handler()
335 mod_timer(&btci->timer, in brcmf_btcoex_handler()
336 jiffies + msecs_to_jiffies(btci->timeout)); in brcmf_btcoex_handler()
337 btci->timer_on = true; in brcmf_btcoex_handler()
341 if (btci->dhcp_done) in brcmf_btcoex_handler()
350 brcmf_err("invalid state=%d !!!\n", btci->bt_state); in brcmf_btcoex_handler()
357 btci->bt_state = BRCMF_BT_DHCP_IDLE; in brcmf_btcoex_handler()
358 btci->timer_on = false; in brcmf_btcoex_handler()
359 brcmf_btcoex_boost_wifi(btci, false); in brcmf_btcoex_handler()
360 cfg80211_crit_proto_stopped(&btci->vif->wdev, GFP_KERNEL); in brcmf_btcoex_handler()
361 brcmf_btcoex_restore_part1(btci); in brcmf_btcoex_handler()
362 btci->vif = NULL; in brcmf_btcoex_handler()
373 struct brcmf_btcoex_info *btci = NULL; in brcmf_btcoex_attach() local
376 btci = kmalloc(sizeof(struct brcmf_btcoex_info), GFP_KERNEL); in brcmf_btcoex_attach()
377 if (!btci) in brcmf_btcoex_attach()
380 btci->bt_state = BRCMF_BT_DHCP_IDLE; in brcmf_btcoex_attach()
383 btci->timer_on = false; in brcmf_btcoex_attach()
384 btci->timeout = BRCMF_BTCOEX_OPPR_WIN_TIME; in brcmf_btcoex_attach()
385 init_timer(&btci->timer); in brcmf_btcoex_attach()
386 btci->timer.data = (ulong)btci; in brcmf_btcoex_attach()
387 btci->timer.function = brcmf_btcoex_timerfunc; in brcmf_btcoex_attach()
388 btci->cfg = cfg; in brcmf_btcoex_attach()
389 btci->saved_regs_part1 = false; in brcmf_btcoex_attach()
390 btci->saved_regs_part2 = false; in brcmf_btcoex_attach()
392 INIT_WORK(&btci->work, brcmf_btcoex_handler); in brcmf_btcoex_attach()
394 cfg->btcoex = btci; in brcmf_btcoex_attach()
423 static void brcmf_btcoex_dhcp_start(struct brcmf_btcoex_info *btci) in brcmf_btcoex_dhcp_start() argument
425 struct brcmf_if *ifp = btci->vif->ifp; in brcmf_btcoex_dhcp_start()
427 btcmf_btcoex_save_part1(btci); in brcmf_btcoex_dhcp_start()
432 btci->dhcp_done = false; in brcmf_btcoex_dhcp_start()
433 btci->bt_state = BRCMF_BT_DHCP_START; in brcmf_btcoex_dhcp_start()
434 schedule_work(&btci->work); in brcmf_btcoex_dhcp_start()
438 static void brcmf_btcoex_dhcp_end(struct brcmf_btcoex_info *btci) in brcmf_btcoex_dhcp_end() argument
441 btci->dhcp_done = true; in brcmf_btcoex_dhcp_end()
442 if (btci->timer_on) { in brcmf_btcoex_dhcp_end()
444 btci->timer_on = false; in brcmf_btcoex_dhcp_end()
445 del_timer_sync(&btci->timer); in brcmf_btcoex_dhcp_end()
448 if (btci->bt_state != BRCMF_BT_DHCP_IDLE) { in brcmf_btcoex_dhcp_end()
450 btci->bt_state); in brcmf_btcoex_dhcp_end()
451 schedule_work(&btci->work); in brcmf_btcoex_dhcp_end()
455 brcmf_btcoex_restore_part1(btci); in brcmf_btcoex_dhcp_end()
470 struct brcmf_btcoex_info *btci = cfg->btcoex; in brcmf_btcoex_set_mode() local
476 if (btci->bt_state != BRCMF_BT_DHCP_IDLE) in brcmf_btcoex_set_mode()
480 btci->timeout = duration; in brcmf_btcoex_set_mode()
481 btci->vif = vif; in brcmf_btcoex_set_mode()
482 brcmf_btcoex_dhcp_start(btci); in brcmf_btcoex_set_mode()
488 if (btci->bt_state != BRCMF_BT_DHCP_IDLE && in brcmf_btcoex_set_mode()
489 vif == btci->vif) { in brcmf_btcoex_set_mode()
490 brcmf_btcoex_dhcp_end(btci); in brcmf_btcoex_set_mode()