Lines Matching +full:max +full:- +full:bitrate
26 /* This tables gives the actual meanings of the bitrate IDs returned
29 int bitrate; /* in 100s of kilobits */ member
52 if (nic_id->id < 0x8000) in determine_firmware_type()
54 else if (nic_id->id == 0x8000 && nic_id->major == 0) in determine_firmware_type()
60 /* Set priv->firmware type, determine firmware properties
64 * If non-NULL stores a firmware description in fw_name.
65 * If non-NULL stores a HW version in hw_ver
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()
121 return -ENODEV; in determine_fw_capabilities()
124 return -ENODEV; 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()
180 err = hw->ops->read_ltv_pr(hw, USER_BAP, in determine_fw_capabilities()
190 * something like : "V2.20-01". in determine_fw_capabilities()
191 * Quick and dirty parsing... - Jean II in determine_fw_capabilities()
193 firmver = ((tmp[1] - '0') << 16) in determine_fw_capabilities()
194 | ((tmp[3] - '0') << 12) in determine_fw_capabilities()
195 | ((tmp[4] - '0') << 8) in determine_fw_capabilities()
196 | ((tmp[6] - '0') << 4) in determine_fw_capabilities()
197 | (tmp[7] - '0'); 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()
216 * download on non-spectrum_cs based cards. in determine_fw_capabilities()
220 * download with the Symbol algorithm on non-spectrum 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()
236 /* D-Link, Linksys, Adtron, ZoomAir, and many others... in determine_fw_capabilities()
239 /* D-Link MAC : 00:40:05:* */ 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()
257 " - several features not supported\n"); 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()
268 return -ENODEV; in determine_fw_capabilities()
281 struct device *dev = priv->dev; in orinoco_hw_read_card_settings()
283 struct hermes *hw = &priv->hw; in orinoco_hw_read_card_settings()
289 err = hw->ops->read_ltv_pr(hw, USER_BAP, HERMES_RID_CNFOWNMACADDR, in orinoco_hw_read_card_settings()
299 err = hw->ops->read_ltv_pr(hw, USER_BAP, HERMES_RID_CNFOWNNAME, 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()
401 dev_err(dev, "Failed to read max retry lifetime\n"); in orinoco_hw_read_card_settings()
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()
430 int orinoco_get_bitratemode(int bitrate, int automatic) in orinoco_get_bitratemode() argument
432 int ratemode = -1; in orinoco_get_bitratemode()
435 if ((bitrate != 10) && (bitrate != 20) && in orinoco_get_bitratemode()
436 (bitrate != 55) && (bitrate != 110)) in orinoco_get_bitratemode()
440 if ((bitrate_table[i].bitrate == bitrate) && in orinoco_get_bitratemode()
449 void orinoco_get_ratemode_cfg(int ratemode, int *bitrate, int *automatic) in orinoco_get_ratemode_cfg() argument
453 *bitrate = bitrate_table[ratemode].bitrate * 100000; in orinoco_get_ratemode_cfg()
459 struct net_device *dev = priv->ndev; in orinoco_hw_program_rids()
461 struct hermes *hw = &priv->hw; in orinoco_hw_program_rids()
466 err = hw->ops->write_ltv(hw, USER_BAP, HERMES_RID_CNFOWNMACADDR, in orinoco_hw_program_rids()
468 dev->dev_addr); in orinoco_hw_program_rids()
471 dev->name, err); in orinoco_hw_program_rids()
477 priv->port_type); in orinoco_hw_program_rids()
480 dev->name, err); 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()
500 "ESSID in IBSS-Ad-Hoc mode.\n", dev->name); in orinoco_hw_program_rids()
506 createibss = priv->createibss; in orinoco_hw_program_rids()
514 dev->name, err); in orinoco_hw_program_rids()
523 dev->name, err); 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()
531 err = hw->ops->write_ltv(hw, USER_BAP, HERMES_RID_CNFOWNSSID, in orinoco_hw_program_rids()
532 HERMES_BYTES_TO_RECLEN(strlen(priv->desired_essid) + 2), in orinoco_hw_program_rids()
536 dev->name, err); in orinoco_hw_program_rids()
539 err = hw->ops->write_ltv(hw, USER_BAP, HERMES_RID_CNFDESIREDSSID, in orinoco_hw_program_rids()
540 HERMES_BYTES_TO_RECLEN(strlen(priv->desired_essid) + 2), in orinoco_hw_program_rids()
544 dev->name, err); 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()
551 err = hw->ops->write_ltv(hw, USER_BAP, HERMES_RID_CNFOWNNAME, in orinoco_hw_program_rids()
552 HERMES_BYTES_TO_RECLEN(strlen(priv->nick) + 2), in orinoco_hw_program_rids()
556 dev->name, err); in orinoco_hw_program_rids()
561 if (priv->has_sensitivity) { in orinoco_hw_program_rids()
564 priv->ap_density); in orinoco_hw_program_rids()
568 dev->name, err); in orinoco_hw_program_rids()
570 priv->has_sensitivity = 0; in orinoco_hw_program_rids()
576 priv->rts_thresh); in orinoco_hw_program_rids()
579 dev->name, err); 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()
594 dev->name, err); in orinoco_hw_program_rids()
598 /* Set bitrate */ in orinoco_hw_program_rids()
601 printk(KERN_ERR "%s: Error %d setting bitrate\n", in orinoco_hw_program_rids()
602 dev->name, err); in orinoco_hw_program_rids()
607 if (priv->has_pm) { in orinoco_hw_program_rids()
610 priv->pm_on); in orinoco_hw_program_rids()
613 dev->name, err); in orinoco_hw_program_rids()
619 priv->pm_mcast); in orinoco_hw_program_rids()
622 dev->name, err); in orinoco_hw_program_rids()
627 priv->pm_period); in orinoco_hw_program_rids()
630 dev->name, err); in orinoco_hw_program_rids()
635 priv->pm_timeout); in orinoco_hw_program_rids()
638 dev->name, err); in orinoco_hw_program_rids()
643 /* Set preamble - only for Symbol so far... */ in orinoco_hw_program_rids()
644 if (priv->has_preamble) { in orinoco_hw_program_rids()
647 priv->preamble); in orinoco_hw_program_rids()
650 dev->name, err); in orinoco_hw_program_rids()
656 if (priv->has_wep || priv->has_wpa) { in orinoco_hw_program_rids()
660 dev->name, err); in orinoco_hw_program_rids()
665 if (priv->iw_mode == NL80211_IFTYPE_MONITOR) { in orinoco_hw_program_rids()
667 dev->type = ARPHRD_IEEE80211; in orinoco_hw_program_rids()
668 err = hw->ops->cmd_wait(hw, HERMES_CMD_TEST | in orinoco_hw_program_rids()
672 dev->type = ARPHRD_ETHER; in orinoco_hw_program_rids()
673 err = hw->ops->cmd_wait(hw, HERMES_CMD_TEST | 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()
692 struct hermes *hw = &priv->hw; in orinoco_hw_get_tkip_iv()
697 return -EINVAL; in orinoco_hw_get_tkip_iv()
699 err = hw->ops->read_ltv(hw, USER_BAP, HERMES_RID_CURRENT_TKIP_IV, in orinoco_hw_get_tkip_iv()
709 struct hermes *hw = &priv->hw; in __orinoco_hw_set_bitrate()
710 int ratemode = priv->bitratemode; in __orinoco_hw_set_bitrate()
714 printk(KERN_ERR "%s: BUG: Invalid bitrate mode %d\n", in __orinoco_hw_set_bitrate()
715 priv->ndev->name, ratemode); in __orinoco_hw_set_bitrate()
716 return -EINVAL; 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()
753 * HERMES_RID_CURRENTTXRATE is the bitrate in Mb/s, in orinoco_hw_get_act_bitrate()
758 *bitrate = 5500000; in orinoco_hw_get_act_bitrate()
760 *bitrate = val * 1000000; in orinoco_hw_get_act_bitrate()
766 *bitrate = bitrate_table[i].bitrate * 100000; in orinoco_hw_get_act_bitrate()
771 printk(KERN_INFO "%s: Unable to determine current bitrate (0x%04hx)\n", in orinoco_hw_get_act_bitrate()
772 priv->ndev->name, val); in orinoco_hw_get_act_bitrate()
773 err = -EIO; in orinoco_hw_get_act_bitrate()
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()
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()
867 return -E2BIG; 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()
882 err = hw->ops->write_ltv(hw, USER_BAP, in __orinoco_hw_setup_wepkeys()
893 priv->tx_key); in __orinoco_hw_setup_wepkeys()
905 struct hermes *hw = &priv->hw; in __orinoco_hw_setup_enc()
912 if (priv->encode_alg == ORINOCO_ALG_WEP) 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()
930 /* Enable the shared-key authentication. */ in __orinoco_hw_setup_enc()
943 if (priv->has_wpa) { in __orinoco_hw_setup_enc()
947 priv->key_mgmt); in __orinoco_hw_setup_enc()
956 if (priv->encode_alg == ORINOCO_ALG_WEP) { in __orinoco_hw_setup_enc()
957 if (priv->wep_restrict || in __orinoco_hw_setup_enc()
958 (priv->firmware_type == FIRMWARE_TYPE_SYMBOL)) in __orinoco_hw_setup_enc()
972 if (priv->iw_mode == NL80211_IFTYPE_MONITOR) in __orinoco_hw_setup_enc()
1007 struct hermes *hw = &priv->hw; in __orinoco_hw_set_tkip_key()
1020 return -EINVAL; in __orinoco_hw_set_tkip_key()
1041 for (k = 100; k > 0; k--) { in __orinoco_hw_set_tkip_key()
1050 ret = -ETIMEDOUT; in __orinoco_hw_set_tkip_key()
1061 struct hermes *hw = &priv->hw; in orinoco_clear_tkip_key()
1069 priv->ndev->name, err, key_idx); in orinoco_clear_tkip_key()
1077 struct hermes *hw = &priv->hw; in __orinoco_hw_set_multicast_list()
1080 if (promisc != priv->promiscuous) { in __orinoco_hw_set_multicast_list()
1086 priv->ndev->name, err); in __orinoco_hw_set_multicast_list()
1088 priv->promiscuous = promisc; in __orinoco_hw_set_multicast_list()
1094 if (!promisc && (mc_count || priv->mc_count)) { in __orinoco_hw_set_multicast_list()
1102 memcpy(mclist.addr[i++], ha->addr, ETH_ALEN); in __orinoco_hw_set_multicast_list()
1105 err = hw->ops->write_ltv(hw, USER_BAP, in __orinoco_hw_set_multicast_list()
1111 priv->ndev->name, err); in __orinoco_hw_set_multicast_list()
1113 priv->mc_count = mc_count; in __orinoco_hw_set_multicast_list()
1118 /* Return : < 0 -> error code ; >= 0 -> length */
1122 struct hermes *hw = &priv->hw; in orinoco_hw_get_essid()
1130 return -EBUSY; in orinoco_hw_get_essid()
1132 if (strlen(priv->desired_essid) > 0) { in orinoco_hw_get_essid()
1134 than from priv->desired_essid, just in case the in orinoco_hw_get_essid()
1139 * may change... - Jean II */ in orinoco_hw_get_essid()
1144 rid = (priv->port_type == 3) ? HERMES_RID_CNFOWNSSID : in orinoco_hw_get_essid()
1147 err = hw->ops->read_ltv(hw, USER_BAP, rid, sizeof(essidbuf), in orinoco_hw_get_essid()
1154 err = hw->ops->read_ltv(hw, USER_BAP, HERMES_RID_CURRENTSSID, in orinoco_hw_get_essid()
1175 struct hermes *hw = &priv->hw; in orinoco_hw_get_freq()
1182 return -EBUSY; in orinoco_hw_get_freq()
1191 err = -EBUSY; in orinoco_hw_get_freq()
1197 priv->ndev->name, channel); in orinoco_hw_get_freq()
1198 err = -EBUSY; in orinoco_hw_get_freq()
1208 err = -EBUSY; in orinoco_hw_get_freq()
1213 int *numrates, s32 *rates, int max) in orinoco_hw_get_bitratelist() argument
1215 struct hermes *hw = &priv->hw; in orinoco_hw_get_bitratelist()
1224 return -EBUSY; in orinoco_hw_get_bitratelist()
1226 err = hw->ops->read_ltv(hw, USER_BAP, HERMES_RID_SUPPORTEDDATARATES, in orinoco_hw_get_bitratelist()
1235 num = min(num, max); in orinoco_hw_get_bitratelist()
1246 struct net_device *dev = priv->ndev; in orinoco_hw_trigger_scan()
1247 struct hermes *hw = &priv->hw; in orinoco_hw_trigger_scan()
1252 return -EBUSY; in orinoco_hw_trigger_scan()
1256 err = -ENETDOWN; in orinoco_hw_trigger_scan()
1263 if (priv->iw_mode == NL80211_IFTYPE_MONITOR) { in orinoco_hw_trigger_scan()
1264 err = -EOPNOTSUPP; in orinoco_hw_trigger_scan()
1268 if (priv->has_hostscan) { in orinoco_hw_trigger_scan()
1269 switch (priv->firmware_type) { in orinoco_hw_trigger_scan()
1287 if (ssid->ssid_len > 0) { in orinoco_hw_trigger_scan()
1289 size_t len = ssid->ssid_len; in orinoco_hw_trigger_scan()
1292 memcpy(idbuf.val, ssid->ssid, len); in orinoco_hw_trigger_scan()
1294 err = hw->ops->write_ltv(hw, USER_BAP, in orinoco_hw_trigger_scan()
1305 if (priv->has_ext_scan) { in orinoco_hw_trigger_scan()
1332 struct hermes *hw = &priv->hw; in orinoco_hw_disassociate()
1341 if (!priv->has_wpa) in orinoco_hw_disassociate()
1342 return -EOPNOTSUPP; in orinoco_hw_disassociate()
1355 struct hermes *hw = &priv->hw; in orinoco_hw_get_current_bssid()
1358 err = hw->ops->read_ltv(hw, USER_BAP, HERMES_RID_CURRENTBSSID, in orinoco_hw_get_current_bssid()