mci.c (d2182b69dcb6a68b1ef6070b2efd094e13dea3f1) mci.c (8a30930563521c9dba73c93b5631be1d0993f78f)
1/*
2 * Copyright (c) 2010-2011 Atheros Communications Inc.
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

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

412}
413
414int ath_mci_setup(struct ath_softc *sc)
415{
416 struct ath_common *common = ath9k_hw_common(sc->sc_ah);
417 struct ath_mci_coex *mci = &sc->mci_coex;
418 int error = 0;
419
1/*
2 * Copyright (c) 2010-2011 Atheros Communications Inc.
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

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

412}
413
414int ath_mci_setup(struct ath_softc *sc)
415{
416 struct ath_common *common = ath9k_hw_common(sc->sc_ah);
417 struct ath_mci_coex *mci = &sc->mci_coex;
418 int error = 0;
419
420 if (!ATH9K_HW_CAP_MCI)
421 return 0;
422
420 mci->sched_buf.bf_len = ATH_MCI_SCHED_BUF_SIZE + ATH_MCI_GPM_BUF_SIZE;
421
422 if (ath_mci_buf_alloc(sc, &mci->sched_buf)) {
423 ath_dbg(common, FATAL, "MCI buffer alloc failed\n");
424 error = -ENOMEM;
425 goto fail;
426 }
427

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

445 return error;
446}
447
448void ath_mci_cleanup(struct ath_softc *sc)
449{
450 struct ath_hw *ah = sc->sc_ah;
451 struct ath_mci_coex *mci = &sc->mci_coex;
452
423 mci->sched_buf.bf_len = ATH_MCI_SCHED_BUF_SIZE + ATH_MCI_GPM_BUF_SIZE;
424
425 if (ath_mci_buf_alloc(sc, &mci->sched_buf)) {
426 ath_dbg(common, FATAL, "MCI buffer alloc failed\n");
427 error = -ENOMEM;
428 goto fail;
429 }
430

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

448 return error;
449}
450
451void ath_mci_cleanup(struct ath_softc *sc)
452{
453 struct ath_hw *ah = sc->sc_ah;
454 struct ath_mci_coex *mci = &sc->mci_coex;
455
456 if (!ATH9K_HW_CAP_MCI)
457 return;
458
453 /*
454 * both schedule and gpm buffers will be released
455 */
456 ath_mci_buf_free(sc, &mci->sched_buf);
457 ar9003_mci_cleanup(ah);
458}
459
460void ath_mci_intr(struct ath_softc *sc)
461{
462 struct ath_mci_coex *mci = &sc->mci_coex;
463 struct ath_hw *ah = sc->sc_ah;
464 struct ath_common *common = ath9k_hw_common(ah);
465 u32 mci_int, mci_int_rxmsg;
466 u32 offset, subtype, opcode;
467 u32 *pgpm;
468 u32 more_data = MCI_GPM_MORE;
469 bool skip_gpm = false;
470
459 /*
460 * both schedule and gpm buffers will be released
461 */
462 ath_mci_buf_free(sc, &mci->sched_buf);
463 ar9003_mci_cleanup(ah);
464}
465
466void ath_mci_intr(struct ath_softc *sc)
467{
468 struct ath_mci_coex *mci = &sc->mci_coex;
469 struct ath_hw *ah = sc->sc_ah;
470 struct ath_common *common = ath9k_hw_common(ah);
471 u32 mci_int, mci_int_rxmsg;
472 u32 offset, subtype, opcode;
473 u32 *pgpm;
474 u32 more_data = MCI_GPM_MORE;
475 bool skip_gpm = false;
476
477 if (!ATH9K_HW_CAP_MCI)
478 return;
479
471 ar9003_mci_get_interrupt(sc->sc_ah, &mci_int, &mci_int_rxmsg);
472
473 if (ar9003_mci_state(ah, MCI_STATE_ENABLE, NULL) == 0) {
474
475 ar9003_mci_state(sc->sc_ah, MCI_STATE_INIT_GPM_OFFSET, NULL);
476 ath_dbg(common, MCI, "MCI interrupt but MCI disabled\n");
477
478 ath_dbg(common, MCI,

--- 181 unchanged lines hidden ---
480 ar9003_mci_get_interrupt(sc->sc_ah, &mci_int, &mci_int_rxmsg);
481
482 if (ar9003_mci_state(ah, MCI_STATE_ENABLE, NULL) == 0) {
483
484 ar9003_mci_state(sc->sc_ah, MCI_STATE_INIT_GPM_OFFSET, NULL);
485 ath_dbg(common, MCI, "MCI interrupt but MCI disabled\n");
486
487 ath_dbg(common, MCI,

--- 181 unchanged lines hidden ---