static INT bcm_open(struct net_device *dev)
{
- struct bcm_mini_adapter *Adapter = GET_BCM_ADAPTER(dev);
+ struct bcm_mini_adapter *ad = GET_BCM_ADAPTER(dev);
- if (Adapter->fw_download_done == false) {
+ if (ad->fw_download_done == false) {
pr_notice(PFX "%s: link up failed (download in progress)\n",
dev->name);
return -EBUSY;
}
- if (netif_msg_ifup(Adapter))
+ if (netif_msg_ifup(ad))
pr_info(PFX "%s: enabling interface\n", dev->name);
- if (Adapter->LinkUpStatus) {
- if (netif_msg_link(Adapter))
+ if (ad->LinkUpStatus) {
+ if (netif_msg_link(ad))
pr_info(PFX "%s: link up\n", dev->name);
- netif_carrier_on(Adapter->dev);
- netif_start_queue(Adapter->dev);
+ netif_carrier_on(ad->dev);
+ netif_start_queue(ad->dev);
}
return 0;
static INT bcm_close(struct net_device *dev)
{
- struct bcm_mini_adapter *Adapter = GET_BCM_ADAPTER(dev);
+ struct bcm_mini_adapter *ad = GET_BCM_ADAPTER(dev);
- if (netif_msg_ifdown(Adapter))
+ if (netif_msg_ifdown(ad))
pr_info(PFX "%s: disabling interface\n", dev->name);
netif_carrier_off(dev);
static netdev_tx_t bcm_transmit(struct sk_buff *skb, struct net_device *dev)
{
- struct bcm_mini_adapter *Adapter = GET_BCM_ADAPTER(dev);
+ struct bcm_mini_adapter *ad = GET_BCM_ADAPTER(dev);
u16 qindex = skb_get_queue_mapping(skb);
- if (Adapter->device_removed || !Adapter->LinkUpStatus)
+ if (ad->device_removed || !ad->LinkUpStatus)
goto drop;
- if (Adapter->TransferMode != IP_PACKET_ONLY_MODE)
+ if (ad->TransferMode != IP_PACKET_ONLY_MODE)
goto drop;
if (INVALID_QUEUE_INDEX == qindex)
goto drop;
- if (Adapter->PackInfo[qindex].uiCurrentPacketsOnHost >=
+ if (ad->PackInfo[qindex].uiCurrentPacketsOnHost >=
SF_MAX_ALLOWED_PACKETS_TO_BACKUP)
return NETDEV_TX_BUSY;
/* Now Enqueue the packet */
- if (netif_msg_tx_queued(Adapter))
+ if (netif_msg_tx_queued(ad))
pr_info(PFX "%s: enqueueing packet to queue %d\n",
dev->name, qindex);
- spin_lock(&Adapter->PackInfo[qindex].SFQueueLock);
- Adapter->PackInfo[qindex].uiCurrentBytesOnHost += skb->len;
- Adapter->PackInfo[qindex].uiCurrentPacketsOnHost++;
+ spin_lock(&ad->PackInfo[qindex].SFQueueLock);
+ ad->PackInfo[qindex].uiCurrentBytesOnHost += skb->len;
+ ad->PackInfo[qindex].uiCurrentPacketsOnHost++;
*((B_UINT32 *) skb->cb + SKB_CB_LATENCY_OFFSET) = jiffies;
- ENQUEUEPACKET(Adapter->PackInfo[qindex].FirstTxQueue,
- Adapter->PackInfo[qindex].LastTxQueue, skb);
- atomic_inc(&Adapter->TotalPacketCount);
- spin_unlock(&Adapter->PackInfo[qindex].SFQueueLock);
+ ENQUEUEPACKET(ad->PackInfo[qindex].FirstTxQueue,
+ ad->PackInfo[qindex].LastTxQueue, skb);
+ atomic_inc(&ad->TotalPacketCount);
+ spin_unlock(&ad->PackInfo[qindex].SFQueueLock);
/* FIXME - this is racy and incorrect, replace with work queue */
- if (!atomic_read(&Adapter->TxPktAvail)) {
- atomic_set(&Adapter->TxPktAvail, 1);
- wake_up(&Adapter->tx_packet_wait_queue);
+ if (!atomic_read(&ad->TxPktAvail)) {
+ atomic_set(&ad->TxPktAvail, 1);
+ wake_up(&ad->tx_packet_wait_queue);
}
return NETDEV_TX_OK;
static void bcm_get_drvinfo(struct net_device *dev,
struct ethtool_drvinfo *info)
{
- struct bcm_mini_adapter *Adapter = GET_BCM_ADAPTER(dev);
- struct bcm_interface_adapter *psIntfAdapter =
- Adapter->pvInterfaceAdapter;
+ struct bcm_mini_adapter *ad = GET_BCM_ADAPTER(dev);
+ struct bcm_interface_adapter *psIntfAdapter = ad->pvInterfaceAdapter;
struct usb_device *udev = interface_to_usbdev(psIntfAdapter->interface);
strlcpy(info->driver, DRV_NAME, sizeof(info->driver));
strlcpy(info->version, DRV_VERSION, sizeof(info->version));
snprintf(info->fw_version, sizeof(info->fw_version), "%u.%u",
- Adapter->uiFlashLayoutMajorVersion,
- Adapter->uiFlashLayoutMinorVersion);
+ ad->uiFlashLayoutMajorVersion,
+ ad->uiFlashLayoutMinorVersion);
usb_make_path(udev, info->bus_info, sizeof(info->bus_info));
}
static u32 bcm_get_link(struct net_device *dev)
{
- struct bcm_mini_adapter *Adapter = GET_BCM_ADAPTER(dev);
+ struct bcm_mini_adapter *ad = GET_BCM_ADAPTER(dev);
- return Adapter->LinkUpStatus;
+ return ad->LinkUpStatus;
}
static u32 bcm_get_msglevel(struct net_device *dev)
{
- struct bcm_mini_adapter *Adapter = GET_BCM_ADAPTER(dev);
+ struct bcm_mini_adapter *ad = GET_BCM_ADAPTER(dev);
- return Adapter->msg_enable;
+ return ad->msg_enable;
}
static void bcm_set_msglevel(struct net_device *dev, u32 level)
{
- struct bcm_mini_adapter *Adapter = GET_BCM_ADAPTER(dev);
+ struct bcm_mini_adapter *ad = GET_BCM_ADAPTER(dev);
- Adapter->msg_enable = level;
+ ad->msg_enable = level;
}
static const struct ethtool_ops bcm_ethtool_ops = {
.set_msglevel = bcm_set_msglevel,
};
-int register_networkdev(struct bcm_mini_adapter *Adapter)
+int register_networkdev(struct bcm_mini_adapter *ad)
{
- struct net_device *net = Adapter->dev;
- struct bcm_interface_adapter *IntfAdapter = Adapter->pvInterfaceAdapter;
+ struct net_device *net = ad->dev;
+ struct bcm_interface_adapter *IntfAdapter = ad->pvInterfaceAdapter;
struct usb_interface *udev = IntfAdapter->interface;
struct usb_device *xdev = IntfAdapter->udev;
SET_NETDEV_DEVTYPE(net, &wimax_type);
/* Read the MAC Address from EEPROM */
- result = ReadMacAddressFromNVM(Adapter);
+ result = ReadMacAddressFromNVM(ad);
if (result != STATUS_SUCCESS) {
dev_err(&udev->dev,
PFX "Error in Reading the mac Address: %d", result);
if (result)
return result;
- gblpnetdev = Adapter->dev;
+ gblpnetdev = ad->dev;
- if (netif_msg_probe(Adapter))
+ if (netif_msg_probe(ad))
dev_info(&udev->dev, PFX "%s: register usb-%s-%s %pM\n",
net->name, xdev->bus->bus_name, xdev->devpath,
net->dev_addr);
return 0;
}
-void unregister_networkdev(struct bcm_mini_adapter *Adapter)
+void unregister_networkdev(struct bcm_mini_adapter *ad)
{
- struct net_device *net = Adapter->dev;
- struct bcm_interface_adapter *IntfAdapter = Adapter->pvInterfaceAdapter;
+ struct net_device *net = ad->dev;
+ struct bcm_interface_adapter *IntfAdapter = ad->pvInterfaceAdapter;
struct usb_interface *udev = IntfAdapter->interface;
struct usb_device *xdev = IntfAdapter->udev;
- if (netif_msg_probe(Adapter))
+ if (netif_msg_probe(ad))
dev_info(&udev->dev, PFX "%s: unregister usb-%s%s\n",
net->name, xdev->bus->bus_name, xdev->devpath);
- unregister_netdev(Adapter->dev);
+ unregister_netdev(ad->dev);
}