Lines Matching refs:priv

69 int determine_fw_capabilities(struct orinoco_private *priv,  in determine_fw_capabilities()  argument
73 struct device *dev = priv->dev; in determine_fw_capabilities()
74 struct hermes *hw = &priv->hw; in determine_fw_capabilities()
101 priv->firmware_type = determine_firmware_type(&nic_id); in determine_fw_capabilities()
134 priv->has_sensitivity = 1; in determine_fw_capabilities()
135 priv->has_mwo = 0; in determine_fw_capabilities()
136 priv->has_preamble = 0; in determine_fw_capabilities()
137 priv->has_port3 = 1; in determine_fw_capabilities()
138 priv->has_ibss = 1; in determine_fw_capabilities()
139 priv->has_wep = 0; in determine_fw_capabilities()
140 priv->has_big_wep = 0; in determine_fw_capabilities()
141 priv->has_alt_txcntl = 0; in determine_fw_capabilities()
142 priv->has_ext_scan = 0; in determine_fw_capabilities()
143 priv->has_wpa = 0; in determine_fw_capabilities()
144 priv->do_fw_download = 0; in determine_fw_capabilities()
147 switch (priv->firmware_type) { in determine_fw_capabilities()
157 priv->has_ibss = (firmver >= 0x60006); in determine_fw_capabilities()
158 priv->has_wep = (firmver >= 0x40020); in determine_fw_capabilities()
159 priv->has_big_wep = 1; /* FIXME: this is wrong - how do we tell in determine_fw_capabilities()
161 priv->has_mwo = (firmver >= 0x60000); in determine_fw_capabilities()
162 priv->has_pm = (firmver >= 0x40020); /* Don't work in 7.52 ? */ in determine_fw_capabilities()
163 priv->ibss_port = 1; in determine_fw_capabilities()
164 priv->has_hostscan = (firmver >= 0x8000a); in determine_fw_capabilities()
165 priv->do_fw_download = 1; in determine_fw_capabilities()
166 priv->broken_monitor = (firmver >= 0x80000); in determine_fw_capabilities()
167 priv->has_alt_txcntl = (firmver >= 0x90000); /* All 9.x ? */ in determine_fw_capabilities()
168 priv->has_ext_scan = (firmver >= 0x90000); /* All 9.x ? */ in determine_fw_capabilities()
169 priv->has_wpa = (firmver >= 0x9002a); in determine_fw_capabilities()
205 priv->has_ibss = (firmver >= 0x20000); in determine_fw_capabilities()
206 priv->has_wep = (firmver >= 0x15012); in determine_fw_capabilities()
207 priv->has_big_wep = (firmver >= 0x20000); in determine_fw_capabilities()
208 priv->has_pm = (firmver >= 0x20000 && firmver < 0x22000) || in determine_fw_capabilities()
211 priv->has_preamble = (firmver >= 0x20000); in determine_fw_capabilities()
212 priv->ibss_port = 4; in determine_fw_capabilities()
226 priv->do_fw_download = (priv->stop_fw != NULL); in determine_fw_capabilities()
228 priv->broken_disableport = (firmver == 0x25013) || in determine_fw_capabilities()
230 priv->has_hostscan = (firmver >= 0x31001) || in determine_fw_capabilities()
248 priv->has_ibss = (firmver >= 0x000700); /* FIXME */ in determine_fw_capabilities()
249 priv->has_big_wep = priv->has_wep = (firmver >= 0x000800); in determine_fw_capabilities()
250 priv->has_pm = (firmver >= 0x000700); in determine_fw_capabilities()
251 priv->has_hostscan = (firmver >= 0x010301); in determine_fw_capabilities()
254 priv->ibss_port = 0; in determine_fw_capabilities()
258 priv->ibss_port = 1; in determine_fw_capabilities()
266 if (priv->firmware_type == FIRMWARE_TYPE_INTERSIL) { in determine_fw_capabilities()
279 int orinoco_hw_read_card_settings(struct orinoco_private *priv, u8 *dev_addr) in orinoco_hw_read_card_settings() argument
281 struct device *dev = priv->dev; in orinoco_hw_read_card_settings()
283 struct hermes *hw = &priv->hw; in orinoco_hw_read_card_settings()
309 memcpy(priv->nick, &nickbuf.val, len); in orinoco_hw_read_card_settings()
310 priv->nick[len] = '\0'; in orinoco_hw_read_card_settings()
312 dev_dbg(dev, "Station name \"%s\"\n", priv->nick); in orinoco_hw_read_card_settings()
316 &priv->channel_mask); in orinoco_hw_read_card_settings()
324 &priv->ap_density); in orinoco_hw_read_card_settings()
325 if (err || priv->ap_density < 1 || priv->ap_density > 3) in orinoco_hw_read_card_settings()
326 priv->has_sensitivity = 0; in orinoco_hw_read_card_settings()
330 &priv->rts_thresh); in orinoco_hw_read_card_settings()
337 if (priv->has_mwo) in orinoco_hw_read_card_settings()
340 &priv->mwo_robust); in orinoco_hw_read_card_settings()
344 &priv->frag_thresh); in orinoco_hw_read_card_settings()
351 if (priv->has_pm) { in orinoco_hw_read_card_settings()
352 priv->pm_on = 0; in orinoco_hw_read_card_settings()
353 priv->pm_mcast = 1; in orinoco_hw_read_card_settings()
356 &priv->pm_period); in orinoco_hw_read_card_settings()
364 &priv->pm_timeout); in orinoco_hw_read_card_settings()
373 if (priv->has_preamble) { in orinoco_hw_read_card_settings()
376 &priv->preamble); in orinoco_hw_read_card_settings()
385 &priv->short_retry_limit); in orinoco_hw_read_card_settings()
392 &priv->long_retry_limit); in orinoco_hw_read_card_settings()
399 &priv->retry_lifetime); in orinoco_hw_read_card_settings()
410 int orinoco_hw_allocate_fid(struct orinoco_private *priv) in orinoco_hw_allocate_fid() argument
412 struct device *dev = priv->dev; in orinoco_hw_allocate_fid()
413 struct hermes *hw = &priv->hw; in orinoco_hw_allocate_fid()
416 err = hw->ops->allocate(hw, priv->nicbuf_size, &priv->txfid); in orinoco_hw_allocate_fid()
417 if (err == -EIO && priv->nicbuf_size > TX_NICBUF_SIZE_BUG) { in orinoco_hw_allocate_fid()
419 priv->nicbuf_size = TX_NICBUF_SIZE_BUG; in orinoco_hw_allocate_fid()
420 err = hw->ops->allocate(hw, priv->nicbuf_size, &priv->txfid); in orinoco_hw_allocate_fid()
457 int orinoco_hw_program_rids(struct orinoco_private *priv) in orinoco_hw_program_rids() argument
459 struct net_device *dev = priv->ndev; in orinoco_hw_program_rids()
461 struct hermes *hw = &priv->hw; in orinoco_hw_program_rids()
477 priv->port_type); in orinoco_hw_program_rids()
484 if (priv->channel != 0 && priv->iw_mode != NL80211_IFTYPE_STATION) { in orinoco_hw_program_rids()
487 priv->channel); in orinoco_hw_program_rids()
490 dev->name, err, priv->channel); in orinoco_hw_program_rids()
495 if (priv->has_ibss) { in orinoco_hw_program_rids()
498 if ((strlen(priv->desired_essid) == 0) && (priv->createibss)) { in orinoco_hw_program_rids()
506 createibss = priv->createibss; in orinoco_hw_program_rids()
520 err = __orinoco_hw_set_wap(priv); in orinoco_hw_program_rids()
528 idbuf.len = cpu_to_le16(strlen(priv->desired_essid)); in orinoco_hw_program_rids()
529 memcpy(&idbuf.val, priv->desired_essid, sizeof(idbuf.val)); in orinoco_hw_program_rids()
532 HERMES_BYTES_TO_RECLEN(strlen(priv->desired_essid) + 2), in orinoco_hw_program_rids()
540 HERMES_BYTES_TO_RECLEN(strlen(priv->desired_essid) + 2), in orinoco_hw_program_rids()
549 idbuf.len = cpu_to_le16(strlen(priv->nick)); in orinoco_hw_program_rids()
550 memcpy(&idbuf.val, priv->nick, sizeof(idbuf.val)); in orinoco_hw_program_rids()
552 HERMES_BYTES_TO_RECLEN(strlen(priv->nick) + 2), in orinoco_hw_program_rids()
561 if (priv->has_sensitivity) { in orinoco_hw_program_rids()
564 priv->ap_density); in orinoco_hw_program_rids()
570 priv->has_sensitivity = 0; in orinoco_hw_program_rids()
576 priv->rts_thresh); in orinoco_hw_program_rids()
584 if (priv->has_mwo) in orinoco_hw_program_rids()
587 priv->mwo_robust); in orinoco_hw_program_rids()
591 priv->frag_thresh); in orinoco_hw_program_rids()
599 err = __orinoco_hw_set_bitrate(priv); in orinoco_hw_program_rids()
607 if (priv->has_pm) { in orinoco_hw_program_rids()
610 priv->pm_on); in orinoco_hw_program_rids()
619 priv->pm_mcast); in orinoco_hw_program_rids()
627 priv->pm_period); in orinoco_hw_program_rids()
635 priv->pm_timeout); in orinoco_hw_program_rids()
644 if (priv->has_preamble) { in orinoco_hw_program_rids()
647 priv->preamble); in orinoco_hw_program_rids()
656 if (priv->has_wep || priv->has_wpa) { in orinoco_hw_program_rids()
657 err = __orinoco_hw_setup_enc(priv); in orinoco_hw_program_rids()
665 if (priv->iw_mode == NL80211_IFTYPE_MONITOR) { in orinoco_hw_program_rids()
680 priv->promiscuous = 0; in orinoco_hw_program_rids()
681 priv->mc_count = 0; in orinoco_hw_program_rids()
684 wdev->iftype = priv->iw_mode; in orinoco_hw_program_rids()
690 int orinoco_hw_get_tkip_iv(struct orinoco_private *priv, int key, u8 *tsc) in orinoco_hw_get_tkip_iv() argument
692 struct hermes *hw = &priv->hw; in orinoco_hw_get_tkip_iv()
707 int __orinoco_hw_set_bitrate(struct orinoco_private *priv) in __orinoco_hw_set_bitrate() argument
709 struct hermes *hw = &priv->hw; in __orinoco_hw_set_bitrate()
710 int ratemode = priv->bitratemode; in __orinoco_hw_set_bitrate()
715 priv->ndev->name, ratemode); in __orinoco_hw_set_bitrate()
719 switch (priv->firmware_type) { in __orinoco_hw_set_bitrate()
738 int orinoco_hw_get_act_bitrate(struct orinoco_private *priv, int *bitrate) in orinoco_hw_get_act_bitrate() argument
740 struct hermes *hw = &priv->hw; in orinoco_hw_get_act_bitrate()
750 switch (priv->firmware_type) { in orinoco_hw_get_act_bitrate()
772 priv->ndev->name, val); in orinoco_hw_get_act_bitrate()
785 int __orinoco_hw_set_wap(struct orinoco_private *priv) in __orinoco_hw_set_wap() argument
789 struct hermes *hw = &priv->hw; in __orinoco_hw_set_wap()
791 switch (priv->firmware_type) { in __orinoco_hw_set_wap()
796 if (priv->bssid_fixed) in __orinoco_hw_set_wap()
808 &priv->desired_bssid); in __orinoco_hw_set_wap()
819 int __orinoco_hw_setup_wepkeys(struct orinoco_private *priv) in __orinoco_hw_setup_wepkeys() argument
821 struct hermes *hw = &priv->hw; in __orinoco_hw_setup_wepkeys()
825 switch (priv->firmware_type) { in __orinoco_hw_setup_wepkeys()
832 int len = min(priv->keys[i].key_len, in __orinoco_hw_setup_wepkeys()
834 memcpy(&keys[i].data, priv->keys[i].key, len); in __orinoco_hw_setup_wepkeys()
850 priv->tx_key); in __orinoco_hw_setup_wepkeys()
862 keylen = priv->keys[priv->tx_key].key_len; in __orinoco_hw_setup_wepkeys()
866 priv->ndev->name, priv->tx_key, keylen); in __orinoco_hw_setup_wepkeys()
879 memcpy(key, priv->keys[i].key, in __orinoco_hw_setup_wepkeys()
880 priv->keys[i].key_len); in __orinoco_hw_setup_wepkeys()
893 priv->tx_key); in __orinoco_hw_setup_wepkeys()
903 int __orinoco_hw_setup_enc(struct orinoco_private *priv) in __orinoco_hw_setup_enc() argument
905 struct hermes *hw = &priv->hw; in __orinoco_hw_setup_enc()
912 if (priv->encode_alg == ORINOCO_ALG_WEP) in __orinoco_hw_setup_enc()
913 __orinoco_hw_setup_wepkeys(priv); in __orinoco_hw_setup_enc()
915 if (priv->wep_restrict) in __orinoco_hw_setup_enc()
920 if (priv->wpa_enabled) in __orinoco_hw_setup_enc()
922 else if (priv->encode_alg == ORINOCO_ALG_WEP) in __orinoco_hw_setup_enc()
927 switch (priv->firmware_type) { in __orinoco_hw_setup_enc()
929 if (priv->encode_alg == ORINOCO_ALG_WEP) { in __orinoco_hw_setup_enc()
941 if (priv->has_wpa) { in __orinoco_hw_setup_enc()
945 priv->key_mgmt); in __orinoco_hw_setup_enc()
954 if (priv->encode_alg == ORINOCO_ALG_WEP) { in __orinoco_hw_setup_enc()
955 if (priv->wep_restrict || in __orinoco_hw_setup_enc()
956 (priv->firmware_type == FIRMWARE_TYPE_SYMBOL)) in __orinoco_hw_setup_enc()
970 if (priv->iw_mode == NL80211_IFTYPE_MONITOR) in __orinoco_hw_setup_enc()
990 int __orinoco_hw_set_tkip_key(struct orinoco_private *priv, int key_idx, in __orinoco_hw_set_tkip_key() argument
1002 struct hermes *hw = &priv->hw; in __orinoco_hw_set_tkip_key()
1053 int orinoco_clear_tkip_key(struct orinoco_private *priv, int key_idx) in orinoco_clear_tkip_key() argument
1055 struct hermes *hw = &priv->hw; in orinoco_clear_tkip_key()
1063 priv->ndev->name, err, key_idx); in orinoco_clear_tkip_key()
1067 int __orinoco_hw_set_multicast_list(struct orinoco_private *priv, in __orinoco_hw_set_multicast_list() argument
1071 struct hermes *hw = &priv->hw; in __orinoco_hw_set_multicast_list()
1074 if (promisc != priv->promiscuous) { in __orinoco_hw_set_multicast_list()
1080 priv->ndev->name, err); in __orinoco_hw_set_multicast_list()
1082 priv->promiscuous = promisc; in __orinoco_hw_set_multicast_list()
1088 if (!promisc && (mc_count || priv->mc_count)) { in __orinoco_hw_set_multicast_list()
1105 priv->ndev->name, err); in __orinoco_hw_set_multicast_list()
1107 priv->mc_count = mc_count; in __orinoco_hw_set_multicast_list()
1113 int orinoco_hw_get_essid(struct orinoco_private *priv, int *active, in orinoco_hw_get_essid() argument
1116 struct hermes *hw = &priv->hw; in orinoco_hw_get_essid()
1123 if (orinoco_lock(priv, &flags) != 0) in orinoco_hw_get_essid()
1126 if (strlen(priv->desired_essid) > 0) { in orinoco_hw_get_essid()
1138 rid = (priv->port_type == 3) ? HERMES_RID_CNFOWNSSID : in orinoco_hw_get_essid()
1162 orinoco_unlock(priv, &flags); in orinoco_hw_get_essid()
1167 int orinoco_hw_get_freq(struct orinoco_private *priv) in orinoco_hw_get_freq() argument
1169 struct hermes *hw = &priv->hw; in orinoco_hw_get_freq()
1175 if (orinoco_lock(priv, &flags) != 0) in orinoco_hw_get_freq()
1191 priv->ndev->name, channel); in orinoco_hw_get_freq()
1199 orinoco_unlock(priv, &flags); in orinoco_hw_get_freq()
1206 int orinoco_hw_get_bitratelist(struct orinoco_private *priv, in orinoco_hw_get_bitratelist() argument
1209 struct hermes *hw = &priv->hw; in orinoco_hw_get_bitratelist()
1217 if (orinoco_lock(priv, &flags) != 0) in orinoco_hw_get_bitratelist()
1222 orinoco_unlock(priv, &flags); in orinoco_hw_get_bitratelist()
1237 int orinoco_hw_trigger_scan(struct orinoco_private *priv, in orinoco_hw_trigger_scan() argument
1240 struct net_device *dev = priv->ndev; in orinoco_hw_trigger_scan()
1241 struct hermes *hw = &priv->hw; in orinoco_hw_trigger_scan()
1245 if (orinoco_lock(priv, &flags) != 0) in orinoco_hw_trigger_scan()
1257 if (priv->iw_mode == NL80211_IFTYPE_MONITOR) { in orinoco_hw_trigger_scan()
1262 if (priv->has_hostscan) { in orinoco_hw_trigger_scan()
1263 switch (priv->firmware_type) { in orinoco_hw_trigger_scan()
1299 if (priv->has_ext_scan) { in orinoco_hw_trigger_scan()
1317 orinoco_unlock(priv, &flags); in orinoco_hw_trigger_scan()
1323 int orinoco_hw_disassociate(struct orinoco_private *priv, in orinoco_hw_disassociate() argument
1326 struct hermes *hw = &priv->hw; in orinoco_hw_disassociate()
1335 if (!priv->has_wpa) in orinoco_hw_disassociate()
1346 int orinoco_hw_get_current_bssid(struct orinoco_private *priv, in orinoco_hw_get_current_bssid() argument
1349 struct hermes *hw = &priv->hw; in orinoco_hw_get_current_bssid()