~ubuntu-branches/debian/wheezy/linux-2.6/wheezy

« back to all changes in this revision

Viewing changes to drivers/net/wireless/ath/ath9k/init.c

  • Committer: Bazaar Package Importer
  • Author(s): Ben Hutchings, Ben Hutchings, Aurelien Jarno
  • Date: 2011-06-07 12:14:05 UTC
  • mfrom: (43.1.9 sid)
  • Revision ID: james.westby@ubuntu.com-20110607121405-i3h1rd7nrnd2b73h
Tags: 2.6.39-2
[ Ben Hutchings ]
* [x86] Enable BACKLIGHT_APPLE, replacing BACKLIGHT_MBP_NVIDIA
  (Closes: #627492)
* cgroups: Disable memory resource controller by default. Allow it
  to be enabled using kernel parameter 'cgroup_enable=memory'.
* rt2800usb: Enable support for more USB devices including
  Linksys WUSB600N (Closes: #596626) (this change was accidentally
  omitted from 2.6.39-1)
* [x86] Remove Celeron from list of processors supporting PAE. Most
  'Celeron M' models do not.
* Update debconf template translations:
  - Swedish (Martin Bagge) (Closes: #628932)
  - French (David Prévot) (Closes: #628191)
* aufs: Update for 2.6.39 (Closes: #627837)
* Add stable 2.6.39.1, including:
  - ext4: dont set PageUptodate in ext4_end_bio()
  - pata_cmd64x: fix boot crash on parisc (Closes: #622997, #622745)
  - ext3: Fix fs corruption when make_indexed_dir() fails
  - netfilter: nf_ct_sip: validate Content-Length in TCP SIP messages
  - sctp: fix race between sctp_bind_addr_free() and
    sctp_bind_addr_conflict()
  - sctp: fix memory leak of the ASCONF queue when free asoc
  - md/bitmap: fix saving of events_cleared and other state
  - cdc_acm: Fix oops when Droids MuIn LCD is connected
  - cx88: Fix conversion from BKL to fine-grained locks (Closes: #619827)
  - keys: Set cred->user_ns in key_replace_session_keyring (CVE-2011-2184)
  - tmpfs: fix race between truncate and writepage
  - nfs41: Correct offset for LAYOUTCOMMIT
  - xen/mmu: fix a race window causing leave_mm BUG()
  - ext4: fix possible use-after-free in ext4_remove_li_request()
  For the complete list of changes, see:
   http://www.kernel.org/pub/linux/kernel/v2.6/ChangeLog-2.6.39.1
* Bump ABI to 2
* netfilter: Enable IP_SET, IP_SET_BITMAP_IP, IP_SET_BITMAP_IPMAC,
  IP_SET_BITMAP_PORT, IP_SET_HASH_IP, IP_SET_HASH_IPPORT,
  IP_SET_HASH_IPPORTIP, IP_SET_HASH_IPPORTNET, IP_SET_HASH_NET,
  IP_SET_HASH_NETPORT, IP_SET_LIST_SET, NETFILTER_XT_SET as modules
  (Closes: #629401)

[ Aurelien Jarno ]
* [mipsel/loongson-2f] Disable_SCSI_LPFC to workaround GCC ICE.

Show diffs side-by-side

added added

removed removed

Lines of Context:
140
140
        RATE(540, 0x0c, 0),
141
141
};
142
142
 
 
143
#ifdef CONFIG_MAC80211_LEDS
 
144
static const struct ieee80211_tpt_blink ath9k_tpt_blink[] = {
 
145
        { .throughput = 0 * 1024, .blink_time = 334 },
 
146
        { .throughput = 1 * 1024, .blink_time = 260 },
 
147
        { .throughput = 5 * 1024, .blink_time = 220 },
 
148
        { .throughput = 10 * 1024, .blink_time = 190 },
 
149
        { .throughput = 20 * 1024, .blink_time = 170 },
 
150
        { .throughput = 50 * 1024, .blink_time = 150 },
 
151
        { .throughput = 70 * 1024, .blink_time = 130 },
 
152
        { .throughput = 100 * 1024, .blink_time = 110 },
 
153
        { .throughput = 200 * 1024, .blink_time = 80 },
 
154
        { .throughput = 300 * 1024, .blink_time = 50 },
 
155
};
 
156
#endif
 
157
 
143
158
static void ath9k_deinit_softc(struct ath_softc *sc);
144
159
 
145
160
/*
250
265
                              struct regulatory_request *request)
251
266
{
252
267
        struct ieee80211_hw *hw = wiphy_to_ieee80211_hw(wiphy);
253
 
        struct ath_wiphy *aphy = hw->priv;
254
 
        struct ath_softc *sc = aphy->sc;
 
268
        struct ath_softc *sc = hw->priv;
255
269
        struct ath_regulatory *reg = ath9k_hw_regulatory(sc->sc_ah);
256
270
 
257
271
        return ath_reg_notifier_apply(wiphy, request, reg);
438
452
        sc->config.cabqReadytime = ATH_CABQ_READY_TIME;
439
453
        ath_cabq_update(sc);
440
454
 
441
 
        for (i = 0; i < WME_NUM_AC; i++)
 
455
        for (i = 0; i < WME_NUM_AC; i++) {
442
456
                sc->tx.txq_map[i] = ath_txq_setup(sc, ATH9K_TX_QUEUE_DATA, i);
443
 
 
 
457
                sc->tx.txq_map[i]->mac80211_qnum = i;
 
458
        }
444
459
        return 0;
445
460
}
446
461
 
512
527
 
513
528
        sc->beacon.slottime = ATH9K_SLOT_TIME_9;
514
529
 
515
 
        for (i = 0; i < ARRAY_SIZE(sc->beacon.bslot); i++) {
 
530
        for (i = 0; i < ARRAY_SIZE(sc->beacon.bslot); i++)
516
531
                sc->beacon.bslot[i] = NULL;
517
 
                sc->beacon.bslot_aphy[i] = NULL;
518
 
        }
519
532
 
520
533
        if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_ANT_DIV_COMB)
521
534
                sc->ant_comb.count = ATH_ANT_DIV_COMB_INIT_COUNT;
533
546
        if (!ah)
534
547
                return -ENOMEM;
535
548
 
 
549
        ah->hw = sc->hw;
536
550
        ah->hw_version.devid = devid;
537
551
        ah->hw_version.subsysid = subsysid;
538
552
        sc->sc_ah = ah;
550
564
        common->btcoex_enabled = ath9k_btcoex_enable == 1;
551
565
        spin_lock_init(&common->cc_lock);
552
566
 
553
 
        spin_lock_init(&sc->wiphy_lock);
554
567
        spin_lock_init(&sc->sc_serial_rw);
555
568
        spin_lock_init(&sc->sc_pm_lock);
556
569
        mutex_init(&sc->mutex);
 
570
#ifdef CONFIG_ATH9K_DEBUGFS
 
571
        spin_lock_init(&sc->nodes_lock);
 
572
        INIT_LIST_HEAD(&sc->nodes);
 
573
#endif
557
574
        tasklet_init(&sc->intr_tq, ath9k_tasklet, (unsigned long)sc);
558
575
        tasklet_init(&sc->bcon_tasklet, ath_beacon_tasklet,
559
576
                     (unsigned long)sc);
695
712
                    const struct ath_bus_ops *bus_ops)
696
713
{
697
714
        struct ieee80211_hw *hw = sc->hw;
698
 
        struct ath_wiphy *aphy = hw->priv;
699
715
        struct ath_common *common;
700
716
        struct ath_hw *ah;
701
717
        int error = 0;
730
746
 
731
747
        ath9k_init_txpower_limits(sc);
732
748
 
 
749
#ifdef CONFIG_MAC80211_LEDS
 
750
        /* must be initialized before ieee80211_register_hw */
 
751
        sc->led_cdev.default_trigger = ieee80211_create_tpt_led_trigger(sc->hw,
 
752
                IEEE80211_TPT_LEDTRIG_FL_RADIO, ath9k_tpt_blink,
 
753
                ARRAY_SIZE(ath9k_tpt_blink));
 
754
#endif
 
755
 
733
756
        /* Register with mac80211 */
734
757
        error = ieee80211_register_hw(hw);
735
758
        if (error)
750
773
 
751
774
        INIT_WORK(&sc->hw_check_work, ath_hw_check);
752
775
        INIT_WORK(&sc->paprd_work, ath_paprd_calibrate);
753
 
        INIT_WORK(&sc->chan_work, ath9k_wiphy_chan_work);
754
 
        INIT_DELAYED_WORK(&sc->wiphy_work, ath9k_wiphy_work);
755
 
        sc->wiphy_scheduler_int = msecs_to_jiffies(500);
756
 
        aphy->last_rssi = ATH_RSSI_DUMMY_MARKER;
 
776
        sc->last_rssi = ATH_RSSI_DUMMY_MARKER;
757
777
 
758
778
        ath_init_leds(sc);
759
779
        ath_start_rfkill_poll(sc);
805
825
void ath9k_deinit_device(struct ath_softc *sc)
806
826
{
807
827
        struct ieee80211_hw *hw = sc->hw;
808
 
        int i = 0;
809
828
 
810
829
        ath9k_ps_wakeup(sc);
811
830
 
814
833
 
815
834
        ath9k_ps_restore(sc);
816
835
 
817
 
        for (i = 0; i < sc->num_sec_wiphy; i++) {
818
 
                struct ath_wiphy *aphy = sc->sec_wiphy[i];
819
 
                if (aphy == NULL)
820
 
                        continue;
821
 
                sc->sec_wiphy[i] = NULL;
822
 
                ieee80211_unregister_hw(aphy->hw);
823
 
                ieee80211_free_hw(aphy->hw);
824
 
        }
825
 
 
826
836
        ieee80211_unregister_hw(hw);
827
837
        ath_rx_cleanup(sc);
828
838
        ath_tx_cleanup(sc);
829
839
        ath9k_deinit_softc(sc);
830
 
        kfree(sc->sec_wiphy);
831
840
}
832
841
 
833
842
void ath_descdma_cleanup(struct ath_softc *sc,