diff options
author | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2014-02-17 04:24:10 -0500 |
---|---|---|
committer | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2014-03-11 13:46:47 -0400 |
commit | b9fae2d54c9ffceed7b57bfc9d4acb0de40b4ba8 (patch) | |
tree | e8c49715ff1a28698ca1dad7749aae0db81aaebd /drivers/net/wireless/iwlwifi/mvm/bt-coex.c | |
parent | 91b80256b6ef64c3ec21210f7b4a0256c2c47f64 (diff) |
iwlwifi: mvm: BT Coex add support for Co-running block
7265 features a new calibration which is called antenna
coupling. The purpose of this calibration (which isn't
really a calibration), is to measure the isolation between
the antennas and that can give us useful information for
the Coex modules.
With this information, we can tune the LookUpTables (LUTs)
that define the BT / WiFi contention policy.
The LUTs currently contain dummy values - but they will be
updated soon.
While at it, change the current code to stop duplicate the
host command while sending. This was needed back then, when
the command was short enough to be allocated on the stack.
Since then, the command grew a lot and is now allocated on
the heap - hence we can use the NOCOPY option instead.
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/mvm/bt-coex.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/mvm/bt-coex.c | 291 |
1 files changed, 288 insertions, 3 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/bt-coex.c b/drivers/net/wireless/iwlwifi/mvm/bt-coex.c index 38a54a3fde34..4ae3c850b57e 100644 --- a/drivers/net/wireless/iwlwifi/mvm/bt-coex.c +++ b/drivers/net/wireless/iwlwifi/mvm/bt-coex.c | |||
@@ -305,6 +305,215 @@ static const __le32 iwl_bt_mprio_lut[BT_COEX_MULTI_PRIO_LUT_SIZE] = { | |||
305 | cpu_to_le32(0x33113311), | 305 | cpu_to_le32(0x33113311), |
306 | }; | 306 | }; |
307 | 307 | ||
308 | struct corunning_block_luts { | ||
309 | u8 range; | ||
310 | __le32 lut20[BT_COEX_CORUN_LUT_SIZE]; | ||
311 | }; | ||
312 | |||
313 | /* | ||
314 | * Ranges for the antenna coupling calibration / co-running block LUT: | ||
315 | * LUT0: [ 0, 12[ | ||
316 | * LUT1: [12, 20[ | ||
317 | * LUT2: [20, 21[ | ||
318 | * LUT3: [21, 23[ | ||
319 | * LUT4: [23, 27[ | ||
320 | * LUT5: [27, 30[ | ||
321 | * LUT6: [30, 32[ | ||
322 | * LUT7: [32, 33[ | ||
323 | * LUT8: [33, - [ | ||
324 | */ | ||
325 | static const struct corunning_block_luts antenna_coupling_ranges[] = { | ||
326 | { | ||
327 | .range = 0, | ||
328 | .lut20 = { | ||
329 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
330 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
331 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
332 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
333 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
334 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
335 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
336 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
337 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
338 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
339 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
340 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
341 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
342 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
343 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
344 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
345 | }, | ||
346 | }, | ||
347 | { | ||
348 | .range = 12, | ||
349 | .lut20 = { | ||
350 | cpu_to_le32(0x00000001), cpu_to_le32(0x00000000), | ||
351 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
352 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
353 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
354 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
355 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
356 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
357 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
358 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
359 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
360 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
361 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
362 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
363 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
364 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
365 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
366 | }, | ||
367 | }, | ||
368 | { | ||
369 | .range = 20, | ||
370 | .lut20 = { | ||
371 | cpu_to_le32(0x00000002), cpu_to_le32(0x00000000), | ||
372 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
373 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
374 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
375 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
376 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
377 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
378 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
379 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
380 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
381 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
382 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
383 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
384 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
385 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
386 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
387 | }, | ||
388 | }, | ||
389 | { | ||
390 | .range = 21, | ||
391 | .lut20 = { | ||
392 | cpu_to_le32(0x00000003), cpu_to_le32(0x00000000), | ||
393 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
394 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
395 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
396 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
397 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
398 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
399 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
400 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
401 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
402 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
403 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
404 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
405 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
406 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
407 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
408 | }, | ||
409 | }, | ||
410 | { | ||
411 | .range = 23, | ||
412 | .lut20 = { | ||
413 | cpu_to_le32(0x00000004), cpu_to_le32(0x00000000), | ||
414 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
415 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
416 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
417 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
418 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
419 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
420 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
421 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
422 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
423 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
424 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
425 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
426 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
427 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
428 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
429 | }, | ||
430 | }, | ||
431 | { | ||
432 | .range = 27, | ||
433 | .lut20 = { | ||
434 | cpu_to_le32(0x00000005), cpu_to_le32(0x00000000), | ||
435 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
436 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
437 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
438 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
439 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
440 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
441 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
442 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
443 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
444 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
445 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
446 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
447 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
448 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
449 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
450 | }, | ||
451 | }, | ||
452 | { | ||
453 | .range = 30, | ||
454 | .lut20 = { | ||
455 | cpu_to_le32(0x00000006), cpu_to_le32(0x00000000), | ||
456 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
457 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
458 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
459 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
460 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
461 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
462 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
463 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
464 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
465 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
466 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
467 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
468 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
469 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
470 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
471 | }, | ||
472 | }, | ||
473 | { | ||
474 | .range = 32, | ||
475 | .lut20 = { | ||
476 | cpu_to_le32(0x00000007), cpu_to_le32(0x00000000), | ||
477 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
478 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
479 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
480 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
481 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
482 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
483 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
484 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
485 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
486 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
487 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
488 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
489 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
490 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
491 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
492 | }, | ||
493 | }, | ||
494 | { | ||
495 | .range = 33, | ||
496 | .lut20 = { | ||
497 | cpu_to_le32(0x00000008), cpu_to_le32(0x00000000), | ||
498 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
499 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
500 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
501 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
502 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
503 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
504 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
505 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
506 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
507 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
508 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
509 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
510 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
511 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
512 | cpu_to_le32(0x00000000), cpu_to_le32(0x00000000), | ||
513 | }, | ||
514 | }, | ||
515 | }; | ||
516 | |||
308 | static enum iwl_bt_coex_lut_type | 517 | static enum iwl_bt_coex_lut_type |
309 | iwl_get_coex_type(struct iwl_mvm *mvm, const struct ieee80211_vif *vif) | 518 | iwl_get_coex_type(struct iwl_mvm *mvm, const struct ieee80211_vif *vif) |
310 | { | 519 | { |
@@ -390,8 +599,6 @@ int iwl_send_bt_init_conf(struct iwl_mvm *mvm) | |||
390 | BT_VALID_LUT | | 599 | BT_VALID_LUT | |
391 | BT_VALID_WIFI_RX_SW_PRIO_BOOST | | 600 | BT_VALID_WIFI_RX_SW_PRIO_BOOST | |
392 | BT_VALID_WIFI_TX_SW_PRIO_BOOST | | 601 | BT_VALID_WIFI_TX_SW_PRIO_BOOST | |
393 | BT_VALID_CORUN_LUT_20 | | ||
394 | BT_VALID_CORUN_LUT_40 | | ||
395 | BT_VALID_ANT_ISOLATION | | 602 | BT_VALID_ANT_ISOLATION | |
396 | BT_VALID_ANT_ISOLATION_THRS | | 603 | BT_VALID_ANT_ISOLATION_THRS | |
397 | BT_VALID_TXTX_DELTA_FREQ_THRS | | 604 | BT_VALID_TXTX_DELTA_FREQ_THRS | |
@@ -401,6 +608,12 @@ int iwl_send_bt_init_conf(struct iwl_mvm *mvm) | |||
401 | if (IWL_MVM_BT_COEX_SYNC2SCO) | 608 | if (IWL_MVM_BT_COEX_SYNC2SCO) |
402 | bt_cmd->flags |= cpu_to_le32(BT_COEX_SYNC2SCO); | 609 | bt_cmd->flags |= cpu_to_le32(BT_COEX_SYNC2SCO); |
403 | 610 | ||
611 | if (IWL_MVM_BT_COEX_CORUNNING) { | ||
612 | bt_cmd->valid_bit_msk = cpu_to_le32(BT_VALID_CORUN_LUT_20 | | ||
613 | BT_VALID_CORUN_LUT_40); | ||
614 | bt_cmd->flags |= cpu_to_le32(BT_COEX_CORUNNING); | ||
615 | } | ||
616 | |||
404 | if (mvm->cfg->bt_shared_single_ant) | 617 | if (mvm->cfg->bt_shared_single_ant) |
405 | memcpy(&bt_cmd->decision_lut, iwl_single_shared_ant, | 618 | memcpy(&bt_cmd->decision_lut, iwl_single_shared_ant, |
406 | sizeof(iwl_single_shared_ant)); | 619 | sizeof(iwl_single_shared_ant)); |
@@ -408,6 +621,12 @@ int iwl_send_bt_init_conf(struct iwl_mvm *mvm) | |||
408 | memcpy(&bt_cmd->decision_lut, iwl_combined_lookup, | 621 | memcpy(&bt_cmd->decision_lut, iwl_combined_lookup, |
409 | sizeof(iwl_combined_lookup)); | 622 | sizeof(iwl_combined_lookup)); |
410 | 623 | ||
624 | /* Take first Co-running block LUT to get started */ | ||
625 | memcpy(bt_cmd->bt4_corun_lut20, antenna_coupling_ranges[0].lut20, | ||
626 | sizeof(bt_cmd->bt4_corun_lut20)); | ||
627 | memcpy(bt_cmd->bt4_corun_lut40, antenna_coupling_ranges[0].lut20, | ||
628 | sizeof(bt_cmd->bt4_corun_lut40)); | ||
629 | |||
411 | memcpy(&bt_cmd->bt_prio_boost, iwl_bt_prio_boost, | 630 | memcpy(&bt_cmd->bt_prio_boost, iwl_bt_prio_boost, |
412 | sizeof(iwl_bt_prio_boost)); | 631 | sizeof(iwl_bt_prio_boost)); |
413 | memcpy(&bt_cmd->bt4_multiprio_lut, iwl_bt_mprio_lut, | 632 | memcpy(&bt_cmd->bt4_multiprio_lut, iwl_bt_mprio_lut, |
@@ -498,7 +717,7 @@ int iwl_mvm_bt_coex_reduced_txp(struct iwl_mvm *mvm, u8 sta_id, bool enable) | |||
498 | struct iwl_host_cmd cmd = { | 717 | struct iwl_host_cmd cmd = { |
499 | .id = BT_CONFIG, | 718 | .id = BT_CONFIG, |
500 | .len = { sizeof(*bt_cmd), }, | 719 | .len = { sizeof(*bt_cmd), }, |
501 | .dataflags = { IWL_HCMD_DFL_DUP, }, | 720 | .dataflags = { IWL_HCMD_DFL_NOCOPY, }, |
502 | .flags = CMD_ASYNC, | 721 | .flags = CMD_ASYNC, |
503 | }; | 722 | }; |
504 | struct iwl_mvm_sta *mvmsta; | 723 | struct iwl_mvm_sta *mvmsta; |
@@ -993,3 +1212,69 @@ void iwl_mvm_bt_coex_vif_change(struct iwl_mvm *mvm) | |||
993 | 1212 | ||
994 | iwl_mvm_bt_coex_notif_handle(mvm); | 1213 | iwl_mvm_bt_coex_notif_handle(mvm); |
995 | } | 1214 | } |
1215 | |||
1216 | int iwl_mvm_rx_ant_coupling_notif(struct iwl_mvm *mvm, | ||
1217 | struct iwl_rx_cmd_buffer *rxb, | ||
1218 | struct iwl_device_cmd *dev_cmd) | ||
1219 | { | ||
1220 | struct iwl_rx_packet *pkt = rxb_addr(rxb); | ||
1221 | u32 ant_isolation = le32_to_cpup((void *)pkt->data); | ||
1222 | u8 __maybe_unused lower_bound, upper_bound; | ||
1223 | u8 lut; | ||
1224 | |||
1225 | struct iwl_bt_coex_cmd *bt_cmd; | ||
1226 | struct iwl_host_cmd cmd = { | ||
1227 | .id = BT_CONFIG, | ||
1228 | .len = { sizeof(*bt_cmd), }, | ||
1229 | .dataflags = { IWL_HCMD_DFL_NOCOPY, }, | ||
1230 | .flags = CMD_SYNC, | ||
1231 | }; | ||
1232 | |||
1233 | if (!IWL_MVM_BT_COEX_CORUNNING) | ||
1234 | return 0; | ||
1235 | |||
1236 | lockdep_assert_held(&mvm->mutex); | ||
1237 | |||
1238 | if (ant_isolation == mvm->last_ant_isol) | ||
1239 | return 0; | ||
1240 | |||
1241 | for (lut = 0; lut < ARRAY_SIZE(antenna_coupling_ranges) - 1; lut++) | ||
1242 | if (ant_isolation < antenna_coupling_ranges[lut + 1].range) | ||
1243 | break; | ||
1244 | |||
1245 | lower_bound = antenna_coupling_ranges[lut].range; | ||
1246 | |||
1247 | if (lut < ARRAY_SIZE(antenna_coupling_ranges) - 1) | ||
1248 | upper_bound = antenna_coupling_ranges[lut + 1].range; | ||
1249 | else | ||
1250 | upper_bound = antenna_coupling_ranges[lut].range; | ||
1251 | |||
1252 | IWL_DEBUG_COEX(mvm, "Antenna isolation=%d in range [%d,%d[, lut=%d\n", | ||
1253 | ant_isolation, lower_bound, upper_bound, lut); | ||
1254 | |||
1255 | mvm->last_ant_isol = ant_isolation; | ||
1256 | |||
1257 | if (mvm->last_corun_lut == lut) | ||
1258 | return 0; | ||
1259 | |||
1260 | mvm->last_corun_lut = lut; | ||
1261 | |||
1262 | bt_cmd = kzalloc(sizeof(*bt_cmd), GFP_KERNEL); | ||
1263 | if (!bt_cmd) | ||
1264 | return 0; | ||
1265 | cmd.data[0] = bt_cmd; | ||
1266 | |||
1267 | bt_cmd->flags = cpu_to_le32(BT_COEX_NW); | ||
1268 | bt_cmd->valid_bit_msk |= cpu_to_le32(BT_VALID_ENABLE | | ||
1269 | BT_VALID_CORUN_LUT_20 | | ||
1270 | BT_VALID_CORUN_LUT_40); | ||
1271 | |||
1272 | /* For the moment, use the same LUT for 20GHz and 40GHz */ | ||
1273 | memcpy(bt_cmd->bt4_corun_lut20, antenna_coupling_ranges[lut].lut20, | ||
1274 | sizeof(bt_cmd->bt4_corun_lut20)); | ||
1275 | |||
1276 | memcpy(bt_cmd->bt4_corun_lut40, antenna_coupling_ranges[lut].lut20, | ||
1277 | sizeof(bt_cmd->bt4_corun_lut40)); | ||
1278 | |||
1279 | return 0; | ||
1280 | } | ||