Commit 1535d596 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Kalle Valo

wifi: remove orphaned orinoco driver

Orinoco is a PIO-only ISA/PCMCIA 802.11b device with extra bus interface
connections for PCI/Cardbus/mini-PCI and a few pre-2002 Apple PowerMac
variants. It supports both wireless extensions and CFG80211, but I could
not tell if it requires using both.

This device used to be one of the most common ones 20 years ago, but
has been orphaned for most of the time since then, and the conversion
to cfg80211 has stalled in 2010.
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarKalle Valo <kvalo@kernel.org>
parent 757a46c2
......@@ -16068,13 +16068,6 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/hubcap/linux.git
F: Documentation/filesystems/orangefs.rst
F: fs/orangefs/
ORINOCO DRIVER
L: linux-wireless@vger.kernel.org
S: Orphan
W: https://wireless.wiki.kernel.org/en/users/Drivers/orinoco
W: http://www.nongnu.org/orinoco/
F: drivers/net/wireless/intersil/orinoco/
OV2659 OMNIVISION SENSOR DRIVER
M: "Lad, Prabhakar" <prabhakar.csengg@gmail.com>
L: linux-media@vger.kernel.org
......
......@@ -12,7 +12,6 @@ config WLAN_VENDOR_INTERSIL
if WLAN_VENDOR_INTERSIL
source "drivers/net/wireless/intersil/orinoco/Kconfig"
source "drivers/net/wireless/intersil/p54/Kconfig"
endif # WLAN_VENDOR_INTERSIL
# SPDX-License-Identifier: GPL-2.0-only
obj-$(CONFIG_HERMES) += orinoco/
obj-$(CONFIG_P54_COMMON) += p54/
# SPDX-License-Identifier: GPL-2.0-only
config HERMES
tristate "Hermes chipset 802.11b support (Orinoco/Prism2/Symbol)"
depends on (PPC_PMAC || PCI || PCMCIA)
depends on CFG80211
select CFG80211_WEXT_EXPORT
select WIRELESS_EXT
select WEXT_SPY
select WEXT_PRIV
select FW_LOADER
select CRYPTO
select CRYPTO_MICHAEL_MIC
help
A driver for 802.11b wireless cards based on the "Hermes" or
Intersil HFA384x (Prism 2) MAC controller. This includes the vast
majority of the PCMCIA 802.11b cards (which are nearly all rebadges)
- except for the Cisco/Aironet cards. Cards supported include the
Apple Airport (not a PCMCIA card), WavelanIEEE/Orinoco,
Cabletron/EnteraSys Roamabout, ELSA AirLancer, MELCO Buffalo, Avaya,
IBM High Rate Wireless, Farralon Syyline, Samsung MagicLAN, Netgear
MA401, LinkSys WPC-11, D-Link DWL-650, 3Com AirConnect, Intel
IPW2011, and Symbol Spectrum24 High Rate amongst others.
This option includes the guts of the driver, but in order to
actually use a card you will also need to enable support for PCMCIA
Hermes cards, PLX9052 based PCI adaptors or the Apple Airport below.
You will also very likely also need the Wireless Tools in order to
configure your card and that /etc/pcmcia/wireless.opts works :
<https://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html>
config HERMES_PRISM
bool "Support Prism 2/2.5 chipset"
depends on HERMES
help
Say Y to enable support for Prism 2 and 2.5 chipsets. These
chipsets are better handled by the hostap driver. This driver
would not support WPA or firmware download for Prism chipset.
If you are not sure, say N.
config HERMES_CACHE_FW_ON_INIT
bool "Cache Hermes firmware on driver initialisation"
depends on HERMES
default y
help
Say Y to cache any firmware required by the Hermes drivers
on startup. The firmware will remain cached until the
driver is unloaded. The cache uses 64K of RAM.
Otherwise load the firmware from userspace as required. In
this case the driver should be unloaded and restarted
whenever the firmware is changed.
If you are not sure, say Y.
config APPLE_AIRPORT
tristate "Apple Airport support (built-in)"
depends on PPC_PMAC && HERMES
help
Say Y here to support the Airport 802.11b wireless Ethernet hardware
built into the Macintosh iBook and other recent PowerPC-based
Macintosh machines. This is essentially a Lucent Orinoco card with
a non-standard interface.
This driver does not support the Airport Extreme (802.11b/g). Use
the BCM43xx driver for Airport Extreme cards.
config PLX_HERMES
tristate "Hermes in PLX9052 based PCI adaptor support (Netgear MA301 etc.)"
depends on PCI && HERMES
help
Enable support for PCMCIA cards supported by the "Hermes" (aka
orinoco) driver when used in PLX9052 based PCI adaptors. These
adaptors are not a full PCMCIA controller but act as a more limited
PCI <-> PCMCIA bridge. Several vendors sell such adaptors so that
802.11b PCMCIA cards can be used in desktop machines. The Netgear
MA301 is such an adaptor.
config TMD_HERMES
tristate "Hermes in TMD7160 based PCI adaptor support"
depends on PCI && HERMES
help
Enable support for PCMCIA cards supported by the "Hermes" (aka
orinoco) driver when used in TMD7160 based PCI adaptors. These
adaptors are not a full PCMCIA controller but act as a more limited
PCI <-> PCMCIA bridge. Several vendors sell such adaptors so that
802.11b PCMCIA cards can be used in desktop machines.
config NORTEL_HERMES
tristate "Nortel emobility PCI adaptor support"
depends on PCI && HERMES
help
Enable support for PCMCIA cards supported by the "Hermes" (aka
orinoco) driver when used in Nortel emobility PCI adaptors. These
adaptors are not full PCMCIA controllers, but act as a more limited
PCI <-> PCMCIA bridge.
config PCI_HERMES
tristate "Prism 2.5 PCI 802.11b adaptor support"
depends on PCI && HERMES && HERMES_PRISM
help
Enable support for PCI and mini-PCI 802.11b wireless NICs based on
the Prism 2.5 chipset. These are true PCI cards, not the 802.11b
PCMCIA cards bundled with PCI<->PCMCIA adaptors which are also
common. Some of the built-in wireless adaptors in laptops are of
this variety.
config PCMCIA_HERMES
tristate "Hermes PCMCIA card support"
depends on PCMCIA && HERMES && HAS_IOPORT_MAP
help
A driver for "Hermes" chipset based PCMCIA wireless adaptors, such
as the Lucent WavelanIEEE/Orinoco cards and their OEM (Cabletron/
EnteraSys RoamAbout 802.11, ELSA Airlancer, Melco Buffalo and
others). It should also be usable on various Prism II based cards
such as the Linksys, D-Link and Farallon Skyline. It should also
work on Symbol cards such as the 3Com AirConnect and Ericsson WLAN.
You will very likely need the Wireless Tools in order to
configure your card and that /etc/pcmcia/wireless.opts works:
<https://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html>.
config PCMCIA_SPECTRUM
tristate "Symbol Spectrum24 Trilogy PCMCIA card support"
depends on PCMCIA && HERMES && HAS_IOPORT_MAP
help
This is a driver for 802.11b cards using RAM-loadable Symbol
firmware, such as Symbol Wireless Networker LA4100, CompactFlash
cards by Socket Communications and Intel PRO/Wireless 2011B.
This driver requires firmware download on startup. Utilities
for downloading Symbol firmware are available at
<http://sourceforge.net/projects/orinoco/>
config ORINOCO_USB
tristate "Agere Orinoco USB support"
depends on USB && HERMES
select FW_LOADER
help
This driver is for USB versions of the Agere Orinoco card.
# SPDX-License-Identifier: GPL-2.0
#
# Makefile for the orinoco wireless device drivers.
#
orinoco-objs := main.o fw.o hw.o mic.o scan.o wext.o hermes_dld.o hermes.o cfg.o
obj-$(CONFIG_HERMES) += orinoco.o
obj-$(CONFIG_PCMCIA_HERMES) += orinoco_cs.o
obj-$(CONFIG_APPLE_AIRPORT) += airport.o
obj-$(CONFIG_PLX_HERMES) += orinoco_plx.o
obj-$(CONFIG_PCI_HERMES) += orinoco_pci.o
obj-$(CONFIG_TMD_HERMES) += orinoco_tmd.o
obj-$(CONFIG_NORTEL_HERMES) += orinoco_nortel.o
obj-$(CONFIG_PCMCIA_SPECTRUM) += spectrum_cs.o
obj-$(CONFIG_ORINOCO_USB) += orinoco_usb.o
/* airport.c
*
* A driver for "Hermes" chipset based Apple Airport wireless
* card.
*
* Copyright notice & release notes in file main.c
*
* Note specific to airport stub:
*
* 0.05 : first version of the new split driver
* 0.06 : fix possible hang on powerup, add sleep support
*/
#define DRIVER_NAME "airport"
#define PFX DRIVER_NAME ": "
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/mod_devicetable.h>
#include <asm/pmac_feature.h>
#include "orinoco.h"
#define AIRPORT_IO_LEN (0x1000) /* one page */
struct airport {
struct macio_dev *mdev;
void __iomem *vaddr;
unsigned int irq;
int irq_requested;
int ndev_registered;
};
static int
airport_suspend(struct macio_dev *mdev, pm_message_t state)
{
struct orinoco_private *priv = dev_get_drvdata(&mdev->ofdev.dev);
struct net_device *dev = priv->ndev;
struct airport *card = priv->card;
unsigned long flags;
int err;
printk(KERN_DEBUG "%s: Airport entering sleep mode\n", dev->name);
err = orinoco_lock(priv, &flags);
if (err) {
printk(KERN_ERR "%s: hw_unavailable on PBOOK_SLEEP_NOW\n",
dev->name);
return 0;
}
orinoco_down(priv);
orinoco_unlock(priv, &flags);
disable_irq(card->irq);
pmac_call_feature(PMAC_FTR_AIRPORT_ENABLE,
macio_get_of_node(mdev), 0, 0);
return 0;
}
static int
airport_resume(struct macio_dev *mdev)
{
struct orinoco_private *priv = dev_get_drvdata(&mdev->ofdev.dev);
struct net_device *dev = priv->ndev;
struct airport *card = priv->card;
unsigned long flags;
int err;
printk(KERN_DEBUG "%s: Airport waking up\n", dev->name);
pmac_call_feature(PMAC_FTR_AIRPORT_ENABLE,
macio_get_of_node(mdev), 0, 1);
msleep(200);
enable_irq(card->irq);
priv->hw.ops->lock_irqsave(&priv->lock, &flags);
err = orinoco_up(priv);
priv->hw.ops->unlock_irqrestore(&priv->lock, &flags);
return err;
}
static int
airport_detach(struct macio_dev *mdev)
{
struct orinoco_private *priv = dev_get_drvdata(&mdev->ofdev.dev);
struct airport *card = priv->card;
if (card->ndev_registered)
orinoco_if_del(priv);
card->ndev_registered = 0;
if (card->irq_requested)
free_irq(card->irq, priv);
card->irq_requested = 0;
if (card->vaddr)
iounmap(card->vaddr);
card->vaddr = NULL;
macio_release_resource(mdev, 0);
pmac_call_feature(PMAC_FTR_AIRPORT_ENABLE,
macio_get_of_node(mdev), 0, 0);
ssleep(1);
macio_set_drvdata(mdev, NULL);
free_orinocodev(priv);
return 0;
}
static int airport_hard_reset(struct orinoco_private *priv)
{
/* It would be nice to power cycle the Airport for a real hard
* reset, but for some reason although it appears to
* re-initialize properly, it falls in a screaming heap
* shortly afterwards. */
#if 0
struct airport *card = priv->card;
/* Vitally important. If we don't do this it seems we get an
* interrupt somewhere during the power cycle, since
* hw_unavailable is already set it doesn't get ACKed, we get
* into an interrupt loop and the PMU decides to turn us
* off. */
disable_irq(card->irq);
pmac_call_feature(PMAC_FTR_AIRPORT_ENABLE,
macio_get_of_node(card->mdev), 0, 0);
ssleep(1);
pmac_call_feature(PMAC_FTR_AIRPORT_ENABLE,
macio_get_of_node(card->mdev), 0, 1);
ssleep(1);
enable_irq(card->irq);
ssleep(1);
#endif
return 0;
}
static int
airport_attach(struct macio_dev *mdev, const struct of_device_id *match)
{
struct orinoco_private *priv;
struct airport *card;
unsigned long phys_addr;
struct hermes *hw;
if (macio_resource_count(mdev) < 1 || macio_irq_count(mdev) < 1) {
printk(KERN_ERR PFX "Wrong interrupt/addresses in OF tree\n");
return -ENODEV;
}
/* Allocate space for private device-specific data */
priv = alloc_orinocodev(sizeof(*card), &mdev->ofdev.dev,
airport_hard_reset, NULL);
if (!priv) {
printk(KERN_ERR PFX "Cannot allocate network device\n");
return -ENODEV;
}
card = priv->card;
hw = &priv->hw;
card->mdev = mdev;
if (macio_request_resource(mdev, 0, DRIVER_NAME)) {
printk(KERN_ERR PFX "can't request IO resource !\n");
free_orinocodev(priv);
return -EBUSY;
}
macio_set_drvdata(mdev, priv);
/* Setup interrupts & base address */
card->irq = macio_irq(mdev, 0);
phys_addr = macio_resource_start(mdev, 0); /* Physical address */
printk(KERN_DEBUG PFX "Physical address %lx\n", phys_addr);
card->vaddr = ioremap(phys_addr, AIRPORT_IO_LEN);
if (!card->vaddr) {
printk(KERN_ERR PFX "ioremap() failed\n");
goto failed;
}
hermes_struct_init(hw, card->vaddr, HERMES_16BIT_REGSPACING);
/* Power up card */
pmac_call_feature(PMAC_FTR_AIRPORT_ENABLE,
macio_get_of_node(mdev), 0, 1);
ssleep(1);
/* Reset it before we get the interrupt */
hw->ops->init(hw);
if (request_irq(card->irq, orinoco_interrupt, 0, DRIVER_NAME, priv)) {
printk(KERN_ERR PFX "Couldn't get IRQ %d\n", card->irq);
goto failed;
}
card->irq_requested = 1;
/* Initialise the main driver */
if (orinoco_init(priv) != 0) {
printk(KERN_ERR PFX "orinoco_init() failed\n");
goto failed;
}
/* Register an interface with the stack */
if (orinoco_if_add(priv, phys_addr, card->irq, NULL) != 0) {
printk(KERN_ERR PFX "orinoco_if_add() failed\n");
goto failed;
}
card->ndev_registered = 1;
return 0;
failed:
airport_detach(mdev);
return -ENODEV;
} /* airport_attach */
static char version[] __initdata = DRIVER_NAME " " DRIVER_VERSION
" (Benjamin Herrenschmidt <benh@kernel.crashing.org>)";
MODULE_AUTHOR("Benjamin Herrenschmidt <benh@kernel.crashing.org>");
MODULE_DESCRIPTION("Driver for the Apple Airport wireless card.");
MODULE_LICENSE("Dual MPL/GPL");
static const struct of_device_id airport_match[] = {
{
.name = "radio",
},
{},
};
MODULE_DEVICE_TABLE(of, airport_match);
static struct macio_driver airport_driver = {
.driver = {
.name = DRIVER_NAME,
.owner = THIS_MODULE,
.of_match_table = airport_match,
},
.probe = airport_attach,
.remove = airport_detach,
.suspend = airport_suspend,
.resume = airport_resume,
};
static int __init
init_airport(void)
{
printk(KERN_DEBUG "%s\n", version);
return macio_register_driver(&airport_driver);
}
static void __exit
exit_airport(void)
{
macio_unregister_driver(&airport_driver);
}
module_init(init_airport);
module_exit(exit_airport);
/* cfg80211 support
*
* See copyright notice in main.c
*/
#include <linux/ieee80211.h>
#include <net/cfg80211.h>
#include "hw.h"
#include "main.h"
#include "orinoco.h"
#include "cfg.h"
/* Supported bitrates. Must agree with hw.c */
static struct ieee80211_rate orinoco_rates[] = {
{ .bitrate = 10 },
{ .bitrate = 20 },
{ .bitrate = 55 },
{ .bitrate = 110 },
};
static const void * const orinoco_wiphy_privid = &orinoco_wiphy_privid;
/* Called after orinoco_private is allocated. */
void orinoco_wiphy_init(struct wiphy *wiphy)
{
struct orinoco_private *priv = wiphy_priv(wiphy);
wiphy->privid = orinoco_wiphy_privid;
set_wiphy_dev(wiphy, priv->dev);
}
/* Called after firmware is initialised */
int orinoco_wiphy_register(struct wiphy *wiphy)
{
struct orinoco_private *priv = wiphy_priv(wiphy);
int i, channels = 0;
if (priv->firmware_type == FIRMWARE_TYPE_AGERE)
wiphy->max_scan_ssids = 1;
else
wiphy->max_scan_ssids = 0;
wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION);
/* TODO: should we set if we only have demo ad-hoc?
* (priv->has_port3)
*/
if (priv->has_ibss)
wiphy->interface_modes |= BIT(NL80211_IFTYPE_ADHOC);
if (!priv->broken_monitor || force_monitor)
wiphy->interface_modes |= BIT(NL80211_IFTYPE_MONITOR);
priv->band.bitrates = orinoco_rates;
priv->band.n_bitrates = ARRAY_SIZE(orinoco_rates);
/* Only support channels allowed by the card EEPROM */
for (i = 0; i < NUM_CHANNELS; i++) {
if (priv->channel_mask & (1 << i)) {
priv->channels[i].center_freq =
ieee80211_channel_to_frequency(i + 1,
NL80211_BAND_2GHZ);
channels++;
}
}
priv->band.channels = priv->channels;
priv->band.n_channels = channels;
wiphy->bands[NL80211_BAND_2GHZ] = &priv->band;
wiphy->signal_type = CFG80211_SIGNAL_TYPE_MBM;
i = 0;
if (priv->has_wep) {
priv->cipher_suites[i] = WLAN_CIPHER_SUITE_WEP40;
i++;
if (priv->has_big_wep) {
priv->cipher_suites[i] = WLAN_CIPHER_SUITE_WEP104;
i++;
}
}
if (priv->has_wpa) {
priv->cipher_suites[i] = WLAN_CIPHER_SUITE_TKIP;
i++;
}
wiphy->cipher_suites = priv->cipher_suites;
wiphy->n_cipher_suites = i;
wiphy->rts_threshold = priv->rts_thresh;
if (!priv->has_mwo)
wiphy->frag_threshold = priv->frag_thresh + 1;
wiphy->retry_short = priv->short_retry_limit;
wiphy->retry_long = priv->long_retry_limit;
return wiphy_register(wiphy);
}
static int orinoco_change_vif(struct wiphy *wiphy, struct net_device *dev,
enum nl80211_iftype type,
struct vif_params *params)
{
struct orinoco_private *priv = wiphy_priv(wiphy);
int err = 0;
unsigned long lock;
if (orinoco_lock(priv, &lock) != 0)
return -EBUSY;
switch (type) {
case NL80211_IFTYPE_ADHOC:
if (!priv->has_ibss && !priv->has_port3)
err = -EINVAL;
break;
case NL80211_IFTYPE_STATION:
break;
case NL80211_IFTYPE_MONITOR:
if (priv->broken_monitor && !force_monitor) {
wiphy_warn(wiphy,
"Monitor mode support is buggy in this firmware, not enabling\n");
err = -EINVAL;
}
break;
default:
err = -EINVAL;
}
if (!err) {
priv->iw_mode = type;
set_port_type(priv);
err = orinoco_commit(priv);
}
orinoco_unlock(priv, &lock);
return err;
}
static int orinoco_scan(struct wiphy *wiphy,
struct cfg80211_scan_request *request)
{
struct orinoco_private *priv = wiphy_priv(wiphy);
int err;
if (!request)
return -EINVAL;
if (priv->scan_request && priv->scan_request != request)
return -EBUSY;
priv->scan_request = request;
err = orinoco_hw_trigger_scan(priv, request->ssids);
/* On error the we aren't processing the request */
if (err)
priv->scan_request = NULL;
return err;
}
static int orinoco_set_monitor_channel(struct wiphy *wiphy,
struct cfg80211_chan_def *chandef)
{
struct orinoco_private *priv = wiphy_priv(wiphy);
int err = 0;
unsigned long flags;
int channel;
if (!chandef->chan)
return -EINVAL;
if (cfg80211_get_chandef_type(chandef) != NL80211_CHAN_NO_HT)
return -EINVAL;
if (chandef->chan->band != NL80211_BAND_2GHZ)
return -EINVAL;
channel = ieee80211_frequency_to_channel(chandef->chan->center_freq);
if ((channel < 1) || (channel > NUM_CHANNELS) ||
!(priv->channel_mask & (1 << (channel - 1))))
return -EINVAL;
if (orinoco_lock(priv, &flags) != 0)
return -EBUSY;
priv->channel = channel;
if (priv->iw_mode == NL80211_IFTYPE_MONITOR) {
/* Fast channel change - no commit if successful */
struct hermes *hw = &priv->hw;
err = hw->ops->cmd_wait(hw, HERMES_CMD_TEST |
HERMES_TEST_SET_CHANNEL,
channel, NULL);
}
orinoco_unlock(priv, &flags);
return err;
}
static int orinoco_set_wiphy_params(struct wiphy *wiphy, u32 changed)
{
struct orinoco_private *priv = wiphy_priv(wiphy);
int frag_value = -1;
int rts_value = -1;
int err = 0;
if (changed & WIPHY_PARAM_RETRY_SHORT) {
/* Setting short retry not supported */
err = -EINVAL;
}
if (changed & WIPHY_PARAM_RETRY_LONG) {
/* Setting long retry not supported */
err = -EINVAL;
}
if (changed & WIPHY_PARAM_FRAG_THRESHOLD) {
/* Set fragmentation */
if (priv->has_mwo) {
if (wiphy->frag_threshold == -1)
frag_value = 0;
else {
printk(KERN_WARNING "%s: Fixed fragmentation "
"is not supported on this firmware. "
"Using MWO robust instead.\n",
priv->ndev->name);
frag_value = 1;
}
} else {
if (wiphy->frag_threshold == -1)
frag_value = 2346;
else if ((wiphy->frag_threshold < 257) ||
(wiphy->frag_threshold > 2347))
err = -EINVAL;
else
/* cfg80211 value is 257-2347 (odd only)
* orinoco rid has range 256-2346 (even only) */
frag_value = wiphy->frag_threshold & ~0x1;
}
}
if (changed & WIPHY_PARAM_RTS_THRESHOLD) {
/* Set RTS.
*
* Prism documentation suggests default of 2432,
* and a range of 0-3000.
*
* Current implementation uses 2347 as the default and
* the upper limit.
*/
if (wiphy->rts_threshold == -1)
rts_value = 2347;
else if (wiphy->rts_threshold > 2347)
err = -EINVAL;
else
rts_value = wiphy->rts_threshold;
}
if (!err) {
unsigned long flags;
if (orinoco_lock(priv, &flags) != 0)
return -EBUSY;
if (frag_value >= 0) {
if (priv->has_mwo)
priv->mwo_robust = frag_value;
else
priv->frag_thresh = frag_value;
}
if (rts_value >= 0)
priv->rts_thresh = rts_value;
err = orinoco_commit(priv);
orinoco_unlock(priv, &flags);
}
return err;
}
const struct cfg80211_ops orinoco_cfg_ops = {
.change_virtual_intf = orinoco_change_vif,
.set_monitor_channel = orinoco_set_monitor_channel,
.scan = orinoco_scan,
.set_wiphy_params = orinoco_set_wiphy_params,
};
/* cfg80211 support.
*
* See copyright notice in main.c
*/
#ifndef ORINOCO_CFG_H
#define ORINOCO_CFG_H
#include <net/cfg80211.h>
extern const struct cfg80211_ops orinoco_cfg_ops;
void orinoco_wiphy_init(struct wiphy *wiphy);
int orinoco_wiphy_register(struct wiphy *wiphy);
#endif /* ORINOCO_CFG_H */
This diff is collapsed.
/* Firmware file reading and download helpers
*
* See copyright notice in main.c
*/
#ifndef _ORINOCO_FW_H_
#define _ORINOCO_FW_H_
/* Forward declations */
struct orinoco_private;
int orinoco_download(struct orinoco_private *priv);
#if defined(CONFIG_HERMES_CACHE_FW_ON_INIT) || defined(CONFIG_PM_SLEEP)
void orinoco_cache_fw(struct orinoco_private *priv, int ap);
void orinoco_uncache_fw(struct orinoco_private *priv);
#else
#define orinoco_cache_fw(priv, ap) do { } while (0)
#define orinoco_uncache_fw(priv) do { } while (0)
#endif
#endif /* _ORINOCO_FW_H_ */
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/*
* Copyright (C) 2007, David Kilroy
*
* The contents of this file are subject to the Mozilla Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License
* at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
* the License for the specific language governing rights and
* limitations under the License.
*
* Alternatively, the contents of this file may be used under the
* terms of the GNU General Public License version 2 (the "GPL"), in
* which case the provisions of the GPL are applicable instead of the
* above. If you wish to allow the use of your version of this file
* only under the terms of the GPL and not to allow others to use your
* version of this file under the MPL, indicate your decision by
* deleting the provisions above and replace them with the notice and
* other provisions required by the GPL. If you do not delete the
* provisions above, a recipient may use your version of this file
* under either the MPL or the GPL.
*/
#ifndef _HERMES_DLD_H
#define _HERMES_DLD_H
#include "hermes.h"
int hermesi_program_init(struct hermes *hw, u32 offset);
int hermesi_program_end(struct hermes *hw);
int hermes_program(struct hermes *hw, const char *first_block, const void *end);
int hermes_read_pda(struct hermes *hw,
__le16 *pda,
u32 pda_addr,
u16 pda_len,
int use_eeprom);
int hermes_apply_pda(struct hermes *hw,
const char *first_pdr,
const void *pdr_end,
const __le16 *pda,
const void *pda_end);
int hermes_apply_pda_with_defaults(struct hermes *hw,
const char *first_pdr,
const void *pdr_end,
const __le16 *pda,
const void *pda_end);
size_t hermes_blocks_length(const char *first_block, const void *end);
#endif /* _HERMES_DLD_H */
#ifndef _HERMES_RID_H
#define _HERMES_RID_H
/*
* Configuration RIDs
*/
#define HERMES_RID_CNFPORTTYPE 0xFC00
#define HERMES_RID_CNFOWNMACADDR 0xFC01
#define HERMES_RID_CNFDESIREDSSID 0xFC02
#define HERMES_RID_CNFOWNCHANNEL 0xFC03
#define HERMES_RID_CNFOWNSSID 0xFC04
#define HERMES_RID_CNFOWNATIMWINDOW 0xFC05
#define HERMES_RID_CNFSYSTEMSCALE 0xFC06
#define HERMES_RID_CNFMAXDATALEN 0xFC07
#define HERMES_RID_CNFWDSADDRESS 0xFC08
#define HERMES_RID_CNFPMENABLED 0xFC09
#define HERMES_RID_CNFPMEPS 0xFC0A
#define HERMES_RID_CNFMULTICASTRECEIVE 0xFC0B
#define HERMES_RID_CNFMAXSLEEPDURATION 0xFC0C
#define HERMES_RID_CNFPMHOLDOVERDURATION 0xFC0D
#define HERMES_RID_CNFOWNNAME 0xFC0E
#define HERMES_RID_CNFOWNDTIMPERIOD 0xFC10
#define HERMES_RID_CNFWDSADDRESS1 0xFC11
#define HERMES_RID_CNFWDSADDRESS2 0xFC12
#define HERMES_RID_CNFWDSADDRESS3 0xFC13
#define HERMES_RID_CNFWDSADDRESS4 0xFC14
#define HERMES_RID_CNFWDSADDRESS5 0xFC15
#define HERMES_RID_CNFWDSADDRESS6 0xFC16
#define HERMES_RID_CNFMULTICASTPMBUFFERING 0xFC17
#define HERMES_RID_CNFWEPENABLED_AGERE 0xFC20
#define HERMES_RID_CNFAUTHENTICATION_AGERE 0xFC21
#define HERMES_RID_CNFMANDATORYBSSID_SYMBOL 0xFC21
#define HERMES_RID_CNFDROPUNENCRYPTED 0xFC22
#define HERMES_RID_CNFWEPDEFAULTKEYID 0xFC23
#define HERMES_RID_CNFDEFAULTKEY0 0xFC24
#define HERMES_RID_CNFDEFAULTKEY1 0xFC25
#define HERMES_RID_CNFMWOROBUST_AGERE 0xFC25
#define HERMES_RID_CNFDEFAULTKEY2 0xFC26
#define HERMES_RID_CNFDEFAULTKEY3 0xFC27
#define HERMES_RID_CNFWEPFLAGS_INTERSIL 0xFC28
#define HERMES_RID_CNFWEPKEYMAPPINGTABLE 0xFC29
#define HERMES_RID_CNFAUTHENTICATION 0xFC2A
#define HERMES_RID_CNFMAXASSOCSTA 0xFC2B
#define HERMES_RID_CNFKEYLENGTH_SYMBOL 0xFC2B
#define HERMES_RID_CNFTXCONTROL 0xFC2C
#define HERMES_RID_CNFROAMINGMODE 0xFC2D
#define HERMES_RID_CNFHOSTAUTHENTICATION 0xFC2E
#define HERMES_RID_CNFRCVCRCERROR 0xFC30
#define HERMES_RID_CNFMMLIFE 0xFC31
#define HERMES_RID_CNFALTRETRYCOUNT 0xFC32
#define HERMES_RID_CNFBEACONINT 0xFC33
#define HERMES_RID_CNFAPPCFINFO 0xFC34
#define HERMES_RID_CNFSTAPCFINFO 0xFC35
#define HERMES_RID_CNFPRIORITYQUSAGE 0xFC37
#define HERMES_RID_CNFTIMCTRL 0xFC40
#define HERMES_RID_CNFTHIRTY2TALLY 0xFC42
#define HERMES_RID_CNFENHSECURITY 0xFC43
#define HERMES_RID_CNFGROUPADDRESSES 0xFC80
#define HERMES_RID_CNFCREATEIBSS 0xFC81
#define HERMES_RID_CNFFRAGMENTATIONTHRESHOLD 0xFC82
#define HERMES_RID_CNFRTSTHRESHOLD 0xFC83
#define HERMES_RID_CNFTXRATECONTROL 0xFC84
#define HERMES_RID_CNFPROMISCUOUSMODE 0xFC85
#define HERMES_RID_CNFBASICRATES_SYMBOL 0xFC8A
#define HERMES_RID_CNFPREAMBLE_SYMBOL 0xFC8C
#define HERMES_RID_CNFFRAGMENTATIONTHRESHOLD0 0xFC90
#define HERMES_RID_CNFFRAGMENTATIONTHRESHOLD1 0xFC91
#define HERMES_RID_CNFFRAGMENTATIONTHRESHOLD2 0xFC92
#define HERMES_RID_CNFFRAGMENTATIONTHRESHOLD3 0xFC93
#define HERMES_RID_CNFFRAGMENTATIONTHRESHOLD4 0xFC94
#define HERMES_RID_CNFFRAGMENTATIONTHRESHOLD5 0xFC95
#define HERMES_RID_CNFFRAGMENTATIONTHRESHOLD6 0xFC96
#define HERMES_RID_CNFRTSTHRESHOLD0 0xFC97
#define HERMES_RID_CNFRTSTHRESHOLD1 0xFC98
#define HERMES_RID_CNFRTSTHRESHOLD2 0xFC99
#define HERMES_RID_CNFRTSTHRESHOLD3 0xFC9A
#define HERMES_RID_CNFRTSTHRESHOLD4 0xFC9B
#define HERMES_RID_CNFRTSTHRESHOLD5 0xFC9C
#define HERMES_RID_CNFRTSTHRESHOLD6 0xFC9D
#define HERMES_RID_CNFHOSTSCAN_SYMBOL 0xFCAB
#define HERMES_RID_CNFSHORTPREAMBLE 0xFCB0
#define HERMES_RID_CNFWEPKEYS_AGERE 0xFCB0
#define HERMES_RID_CNFEXCLUDELONGPREAMBLE 0xFCB1
#define HERMES_RID_CNFTXKEY_AGERE 0xFCB1
#define HERMES_RID_CNFAUTHENTICATIONRSPTO 0xFCB2
#define HERMES_RID_CNFSCANSSID_AGERE 0xFCB2
#define HERMES_RID_CNFBASICRATES 0xFCB3
#define HERMES_RID_CNFSUPPORTEDRATES 0xFCB4
#define HERMES_RID_CNFADDDEFAULTTKIPKEY_AGERE 0xFCB4
#define HERMES_RID_CNFSETWPAAUTHMGMTSUITE_AGERE 0xFCB5
#define HERMES_RID_CNFREMDEFAULTTKIPKEY_AGERE 0xFCB6
#define HERMES_RID_CNFADDMAPPEDTKIPKEY_AGERE 0xFCB7
#define HERMES_RID_CNFREMMAPPEDTKIPKEY_AGERE 0xFCB8
#define HERMES_RID_CNFSETWPACAPABILITIES_AGERE 0xFCB9
#define HERMES_RID_CNFCACHEDPMKADDRESS 0xFCBA
#define HERMES_RID_CNFREMOVEPMKADDRESS 0xFCBB
#define HERMES_RID_CNFSCANCHANNELS2GHZ 0xFCC2
#define HERMES_RID_CNFDISASSOCIATE 0xFCC8
#define HERMES_RID_CNFTICKTIME 0xFCE0
#define HERMES_RID_CNFSCANREQUEST 0xFCE1
#define HERMES_RID_CNFJOINREQUEST 0xFCE2
#define HERMES_RID_CNFAUTHENTICATESTATION 0xFCE3
#define HERMES_RID_CNFCHANNELINFOREQUEST 0xFCE4
#define HERMES_RID_CNFHOSTSCAN 0xFCE5
/*
* Information RIDs
*/
#define HERMES_RID_MAXLOADTIME 0xFD00
#define HERMES_RID_DOWNLOADBUFFER 0xFD01
#define HERMES_RID_PRIID 0xFD02
#define HERMES_RID_PRISUPRANGE 0xFD03
#define HERMES_RID_CFIACTRANGES 0xFD04
#define HERMES_RID_NICSERNUM 0xFD0A
#define HERMES_RID_NICID 0xFD0B
#define HERMES_RID_MFISUPRANGE 0xFD0C
#define HERMES_RID_CFISUPRANGE 0xFD0D
#define HERMES_RID_CHANNELLIST 0xFD10
#define HERMES_RID_REGULATORYDOMAINS 0xFD11
#define HERMES_RID_TEMPTYPE 0xFD12
#define HERMES_RID_CIS 0xFD13
#define HERMES_RID_STAID 0xFD20
#define HERMES_RID_STASUPRANGE 0xFD21
#define HERMES_RID_MFIACTRANGES 0xFD22
#define HERMES_RID_CFIACTRANGES2 0xFD23
#define HERMES_RID_SECONDARYVERSION_SYMBOL 0xFD24
#define HERMES_RID_PORTSTATUS 0xFD40
#define HERMES_RID_CURRENTSSID 0xFD41
#define HERMES_RID_CURRENTBSSID 0xFD42
#define HERMES_RID_COMMSQUALITY 0xFD43
#define HERMES_RID_CURRENTTXRATE 0xFD44
#define HERMES_RID_CURRENTBEACONINTERVAL 0xFD45
#define HERMES_RID_CURRENTSCALETHRESHOLDS 0xFD46
#define HERMES_RID_PROTOCOLRSPTIME 0xFD47
#define HERMES_RID_SHORTRETRYLIMIT 0xFD48
#define HERMES_RID_LONGRETRYLIMIT 0xFD49
#define HERMES_RID_MAXTRANSMITLIFETIME 0xFD4A
#define HERMES_RID_MAXRECEIVELIFETIME 0xFD4B
#define HERMES_RID_CFPOLLABLE 0xFD4C
#define HERMES_RID_AUTHENTICATIONALGORITHMS 0xFD4D
#define HERMES_RID_PRIVACYOPTIONIMPLEMENTED 0xFD4F
#define HERMES_RID_DBMCOMMSQUALITY_INTERSIL 0xFD51
#define HERMES_RID_CURRENTTXRATE1 0xFD80
#define HERMES_RID_CURRENTTXRATE2 0xFD81
#define HERMES_RID_CURRENTTXRATE3 0xFD82
#define HERMES_RID_CURRENTTXRATE4 0xFD83
#define HERMES_RID_CURRENTTXRATE5 0xFD84
#define HERMES_RID_CURRENTTXRATE6 0xFD85
#define HERMES_RID_OWNMACADDR 0xFD86
#define HERMES_RID_SCANRESULTSTABLE 0xFD88
#define HERMES_RID_CURRENT_COUNTRY_INFO 0xFD89
#define HERMES_RID_CURRENT_WPA_IE 0xFD8A
#define HERMES_RID_CURRENT_TKIP_IV 0xFD8B
#define HERMES_RID_CURRENT_ASSOC_REQ_INFO 0xFD8C
#define HERMES_RID_CURRENT_ASSOC_RESP_INFO 0xFD8D
#define HERMES_RID_TXQUEUEEMPTY 0xFD91
#define HERMES_RID_PHYTYPE 0xFDC0
#define HERMES_RID_CURRENTCHANNEL 0xFDC1
#define HERMES_RID_CURRENTPOWERSTATE 0xFDC2
#define HERMES_RID_CCAMODE 0xFDC3
#define HERMES_RID_SUPPORTEDDATARATES 0xFDC6
#define HERMES_RID_BUILDSEQ 0xFFFE
#define HERMES_RID_FWID 0xFFFF
#endif
This diff is collapsed.
/* Encapsulate basic setting changes on Hermes hardware
*
* See copyright notice in main.c
*/
#ifndef _ORINOCO_HW_H_
#define _ORINOCO_HW_H_
#include <linux/types.h>
#include <linux/wireless.h>
#include <net/cfg80211.h>
/* Hardware BAPs */
#define USER_BAP 0
#define IRQ_BAP 1
/* WEP key sizes */
#define SMALL_KEY_SIZE 5
#define LARGE_KEY_SIZE 13
/* Number of supported channels */
#define NUM_CHANNELS 14
/* Forward declarations */
struct orinoco_private;
int determine_fw_capabilities(struct orinoco_private *priv, char *fw_name,
size_t fw_name_len, u32 *hw_ver);
int orinoco_hw_read_card_settings(struct orinoco_private *priv, u8 *dev_addr);
int orinoco_hw_allocate_fid(struct orinoco_private *priv);
int orinoco_get_bitratemode(int bitrate, int automatic);
void orinoco_get_ratemode_cfg(int ratemode, int *bitrate, int *automatic);
int orinoco_hw_program_rids(struct orinoco_private *priv);
int orinoco_hw_get_tkip_iv(struct orinoco_private *priv, int key, u8 *tsc);
int __orinoco_hw_set_bitrate(struct orinoco_private *priv);
int orinoco_hw_get_act_bitrate(struct orinoco_private *priv, int *bitrate);
int __orinoco_hw_set_wap(struct orinoco_private *priv);
int __orinoco_hw_setup_wepkeys(struct orinoco_private *priv);
int __orinoco_hw_setup_enc(struct orinoco_private *priv);
int __orinoco_hw_set_tkip_key(struct orinoco_private *priv, int key_idx,
int set_tx, const u8 *key, size_t key_len,
const u8 *rsc, size_t rsc_len,
const u8 *tsc, size_t tsc_len);
int orinoco_clear_tkip_key(struct orinoco_private *priv, int key_idx);
int __orinoco_hw_set_multicast_list(struct orinoco_private *priv,
struct net_device *dev,
int mc_count, int promisc);
int orinoco_hw_get_essid(struct orinoco_private *priv, int *active,
char buf[IW_ESSID_MAX_SIZE + 1]);
int orinoco_hw_get_freq(struct orinoco_private *priv);
int orinoco_hw_get_bitratelist(struct orinoco_private *priv,
int *numrates, s32 *rates, int max);
int orinoco_hw_trigger_scan(struct orinoco_private *priv,
const struct cfg80211_ssid *ssid);
int orinoco_hw_disassociate(struct orinoco_private *priv,
u8 *addr, u16 reason_code);
int orinoco_hw_get_current_bssid(struct orinoco_private *priv,
u8 *addr);
#endif /* _ORINOCO_HW_H_ */
This diff is collapsed.
/* Exports from main to helper modules
*
* See copyright notice in main.c
*/
#ifndef _ORINOCO_MAIN_H_
#define _ORINOCO_MAIN_H_
#include <linux/ieee80211.h>
#include "orinoco.h"
/********************************************************************/
/* Compile time configuration and compatibility stuff */
/********************************************************************/
/* We do this this way to avoid ifdefs in the actual code */
#ifdef WIRELESS_SPY
#define SPY_NUMBER(priv) (priv->spy_data.spy_number)
#else
#define SPY_NUMBER(priv) 0
#endif /* WIRELESS_SPY */
/********************************************************************/
/* Export module parameter */
extern int force_monitor;
/* Forward declarations */
struct net_device;
struct work_struct;
void set_port_type(struct orinoco_private *priv);
int orinoco_commit(struct orinoco_private *priv);
void orinoco_reset(struct work_struct *work);
/* Information element helpers - find a home for these... */
#define WPA_OUI_TYPE "\x00\x50\xF2\x01"
#define WPA_SELECTOR_LEN 4
static inline u8 *orinoco_get_wpa_ie(u8 *data, size_t len)
{
u8 *p = data;
while ((p + 2 + WPA_SELECTOR_LEN) < (data + len)) {
if ((p[0] == WLAN_EID_VENDOR_SPECIFIC) &&
(memcmp(&p[2], WPA_OUI_TYPE, WPA_SELECTOR_LEN) == 0))
return p;
p += p[1] + 2;
}
return NULL;
}
#endif /* _ORINOCO_MAIN_H_ */
/* Orinoco MIC helpers
*
* See copyright notice in main.c
*/
#include <linux/kernel.h>
#include <linux/string.h>
#include <linux/if_ether.h>
#include <linux/scatterlist.h>
#include <crypto/hash.h>
#include "orinoco.h"
#include "mic.h"
/********************************************************************/
/* Michael MIC crypto setup */
/********************************************************************/
int orinoco_mic_init(struct orinoco_private *priv)
{
priv->tx_tfm_mic = crypto_alloc_shash("michael_mic", 0, 0);
if (IS_ERR(priv->tx_tfm_mic)) {
printk(KERN_DEBUG "%s: could not allocate "
"crypto API michael_mic\n", __func__);
priv->tx_tfm_mic = NULL;
return -ENOMEM;
}
priv->rx_tfm_mic = crypto_alloc_shash("michael_mic", 0, 0);
if (IS_ERR(priv->rx_tfm_mic)) {
printk(KERN_DEBUG "%s: could not allocate "
"crypto API michael_mic\n", __func__);
priv->rx_tfm_mic = NULL;
return -ENOMEM;
}
return 0;
}
void orinoco_mic_free(struct orinoco_private *priv)
{
if (priv->tx_tfm_mic)
crypto_free_shash(priv->tx_tfm_mic);
if (priv->rx_tfm_mic)
crypto_free_shash(priv->rx_tfm_mic);
}
int orinoco_mic(struct crypto_shash *tfm_michael, u8 *key,
u8 *da, u8 *sa, u8 priority,
u8 *data, size_t data_len, u8 *mic)
{
SHASH_DESC_ON_STACK(desc, tfm_michael);
u8 hdr[ETH_HLEN + 2]; /* size of header + padding */
int err;
if (tfm_michael == NULL) {
printk(KERN_WARNING "%s: tfm_michael == NULL\n", __func__);
return -1;
}
/* Copy header into buffer. We need the padding on the end zeroed */
memcpy(&hdr[0], da, ETH_ALEN);
memcpy(&hdr[ETH_ALEN], sa, ETH_ALEN);
hdr[ETH_ALEN * 2] = priority;
hdr[ETH_ALEN * 2 + 1] = 0;
hdr[ETH_ALEN * 2 + 2] = 0;
hdr[ETH_ALEN * 2 + 3] = 0;
desc->tfm = tfm_michael;
err = crypto_shash_setkey(tfm_michael, key, MIC_KEYLEN);
if (err)
return err;
err = crypto_shash_init(desc);
if (err)
return err;
err = crypto_shash_update(desc, hdr, sizeof(hdr));
if (err)
return err;
err = crypto_shash_update(desc, data, data_len);
if (err)
return err;
err = crypto_shash_final(desc, mic);
shash_desc_zero(desc);
return err;
}
/* Orinoco MIC helpers
*
* See copyright notice in main.c
*/
#ifndef _ORINOCO_MIC_H_
#define _ORINOCO_MIC_H_
#include <linux/types.h>
#include <crypto/hash.h>
#define MICHAEL_MIC_LEN 8
/* Forward declarations */
struct orinoco_private;
struct crypto_ahash;
int orinoco_mic_init(struct orinoco_private *priv);
void orinoco_mic_free(struct orinoco_private *priv);
int orinoco_mic(struct crypto_shash *tfm_michael, u8 *key,
u8 *da, u8 *sa, u8 priority,
u8 *data, size_t data_len, u8 *mic);
#endif /* ORINOCO_MIC_H */
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/* orinoco_pci.h
*
* Common code for all Orinoco drivers for PCI devices, including
* both native PCI and PCMCIA-to-PCI bridges.
*
* Copyright (C) 2005, Pavel Roskin.
* See main.c for license.
*/
#ifndef _ORINOCO_PCI_H
#define _ORINOCO_PCI_H
#include <linux/netdevice.h>
/* Driver specific data */
struct orinoco_pci_card {
void __iomem *bridge_io;
void __iomem *attr_io;
};
static int __maybe_unused orinoco_pci_suspend(struct device *dev_d)
{
struct pci_dev *pdev = to_pci_dev(dev_d);
struct orinoco_private *priv = pci_get_drvdata(pdev);
orinoco_down(priv);
free_irq(pdev->irq, priv);
return 0;
}
static int __maybe_unused orinoco_pci_resume(struct device *dev_d)
{
struct pci_dev *pdev = to_pci_dev(dev_d);
struct orinoco_private *priv = pci_get_drvdata(pdev);
struct net_device *dev = priv->ndev;
int err;
err = request_irq(pdev->irq, orinoco_interrupt, IRQF_SHARED,
dev->name, priv);
if (err) {
printk(KERN_ERR "%s: cannot re-allocate IRQ on resume\n",
dev->name);
return -EBUSY;
}
return orinoco_up(priv);
}
static SIMPLE_DEV_PM_OPS(orinoco_pci_pm_ops,
orinoco_pci_suspend,
orinoco_pci_resume);
#endif /* _ORINOCO_PCI_H */
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/* Helpers for managing scan queues
*
* See copyright notice in main.c
*/
#ifndef _ORINOCO_SCAN_H_
#define _ORINOCO_SCAN_H_
/* Forward declarations */
struct orinoco_private;
struct agere_ext_scan_info;
/* Add scan results */
void orinoco_add_extscan_result(struct orinoco_private *priv,
struct agere_ext_scan_info *atom,
size_t len);
void orinoco_add_hostscan_results(struct orinoco_private *dev,
unsigned char *buf,
size_t len);
void orinoco_scan_done(struct orinoco_private *priv, bool abort);
#endif /* _ORINOCO_SCAN_H_ */
This diff is collapsed.
This diff is collapsed.
/* Wireless extensions support.
*
* See copyright notice in main.c
*/
#ifndef _ORINOCO_WEXT_H_
#define _ORINOCO_WEXT_H_
#include <net/iw_handler.h>
/* Structure defining all our WEXT handlers */
extern const struct iw_handler_def orinoco_handler_def;
#endif /* _ORINOCO_WEXT_H_ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment