]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/staging/vt6655/device_main.c
staging: vt6655: remove unused multicast_limit.
[karo-tx-linux.git] / drivers / staging / vt6655 / device_main.c
index 86c24a1ab4fa4211219a8fc741d51494ad7f7a22..fcc4510f81b35450e846a18bca81f87fcf956af6 100644 (file)
@@ -128,14 +128,8 @@ DEVICE_PARAM(BasebandType, "baseband type");
 /*
  * Static vars definitions
  */
-static CHIP_INFO chip_info_table[] = {
-       { VT3253,       "VIA Networking Solomon-A/B/G Wireless LAN Adapter ",
-         256, 1,     DEVICE_FLAGS_IP_ALIGN|DEVICE_FLAGS_TX_ALIGN },
-       {0, NULL}
-};
-
 static const struct pci_device_id vt6655_pci_id_table[] = {
-       { PCI_VDEVICE(VIA, 0x3253), (kernel_ulong_t)chip_info_table},
+       { PCI_VDEVICE(VIA, 0x3253) },
        { 0, }
 };
 
@@ -143,7 +137,7 @@ static const struct pci_device_id vt6655_pci_id_table[] = {
 
 static int  vt6655_probe(struct pci_dev *pcid, const struct pci_device_id *ent);
 static void vt6655_init_info(struct pci_dev *pcid,
-                            struct vnt_private **ppDevice, PCHIP_INFO);
+                            struct vnt_private **ppDevice);
 static void device_free_info(struct vnt_private *pDevice);
 static bool device_get_pci_info(struct vnt_private *, struct pci_dev *pcid);
 static void device_print_info(struct vnt_private *pDevice);
@@ -168,16 +162,6 @@ static void device_free_rings(struct vnt_private *pDevice);
 
 /*---------------------  Export Functions  --------------------------*/
 
-static char *get_chip_name(int chip_id)
-{
-       int i;
-
-       for (i = 0; chip_info_table[i].name != NULL; i++)
-               if (chip_info_table[i].chip_id == chip_id)
-                       break;
-       return chip_info_table[i].name;
-}
-
 static void vt6655_remove(struct pci_dev *pcid)
 {
        struct vnt_private *pDevice = pci_get_drvdata(pcid);
@@ -447,24 +431,17 @@ static void device_init_registers(struct vnt_private *pDevice)
 
 static void device_print_info(struct vnt_private *pDevice)
 {
-       dev_info(&pDevice->pcid->dev, "%s\n", get_chip_name(pDevice->chip_id));
-
        dev_info(&pDevice->pcid->dev, "MAC=%pM IO=0x%lx Mem=0x%lx IRQ=%d\n",
                 pDevice->abyCurrentNetAddr, (unsigned long)pDevice->ioaddr,
                 (unsigned long)pDevice->PortOffset, pDevice->pcid->irq);
 }
 
 static void vt6655_init_info(struct pci_dev *pcid,
-                            struct vnt_private **ppDevice,
-                            PCHIP_INFO pChip_info)
+                            struct vnt_private **ppDevice)
 {
        memset(*ppDevice, 0, sizeof(**ppDevice));
 
        (*ppDevice)->pcid = pcid;
-       (*ppDevice)->chip_id = pChip_info->chip_id;
-       (*ppDevice)->io_size = pChip_info->io_size;
-       (*ppDevice)->nTxQueues = pChip_info->nTxQueue;
-       (*ppDevice)->multicast_limit = 32;
 
        spin_lock_init(&((*ppDevice)->lock));
 }
@@ -707,10 +684,9 @@ static void device_init_td0_ring(struct vnt_private *pDevice)
                pDesc = &(pDevice->apTD0Rings[i]);
                pDesc->td_info = alloc_td_info();
 
-               if (pDevice->flags & DEVICE_FLAGS_TX_ALIGN) {
-                       pDesc->td_info->buf = pDevice->tx0_bufs + (i)*PKT_BUF_SZ;
-                       pDesc->td_info->buf_dma = pDevice->tx_bufs_dma0 + (i)*PKT_BUF_SZ;
-               }
+               pDesc->td_info->buf = pDevice->tx0_bufs + i * PKT_BUF_SZ;
+               pDesc->td_info->buf_dma = pDevice->tx_bufs_dma0 + i * PKT_BUF_SZ;
+
                pDesc->next = &(pDevice->apTD0Rings[(i+1) % pDevice->sOpts.nTxDescs[0]]);
                pDesc->next_desc = cpu_to_le32(curr + sizeof(struct vnt_tx_desc));
        }
@@ -733,10 +709,9 @@ static void device_init_td1_ring(struct vnt_private *pDevice)
                pDesc = &(pDevice->apTD1Rings[i]);
                pDesc->td_info = alloc_td_info();
 
-               if (pDevice->flags & DEVICE_FLAGS_TX_ALIGN) {
-                       pDesc->td_info->buf = pDevice->tx1_bufs + (i) * PKT_BUF_SZ;
-                       pDesc->td_info->buf_dma = pDevice->tx_bufs_dma1 + (i) * PKT_BUF_SZ;
-               }
+               pDesc->td_info->buf = pDevice->tx1_bufs + i * PKT_BUF_SZ;
+               pDesc->td_info->buf_dma = pDevice->tx_bufs_dma1 + i * PKT_BUF_SZ;
+
                pDesc->next = &(pDevice->apTD1Rings[(i + 1) % pDevice->sOpts.nTxDescs[1]]);
                pDesc->next_desc = cpu_to_le32(curr + sizeof(struct vnt_tx_desc));
        }
@@ -1652,7 +1627,6 @@ static int vnt_init(struct vnt_private *priv)
 static int
 vt6655_probe(struct pci_dev *pcid, const struct pci_device_id *ent)
 {
-       PCHIP_INFO  pChip_info = (PCHIP_INFO)ent->driver_data;
        struct vnt_private *priv;
        struct ieee80211_hw *hw;
        struct wiphy *wiphy;
@@ -1672,7 +1646,7 @@ vt6655_probe(struct pci_dev *pcid, const struct pci_device_id *ent)
 
        priv = hw->priv;
 
-       vt6655_init_info(pcid, &priv, pChip_info);
+       vt6655_init_info(pcid, &priv);
 
        priv->hw = hw;
 
@@ -1692,54 +1666,8 @@ vt6655_probe(struct pci_dev *pcid, const struct pci_device_id *ent)
                return -ENODEV;
        }
 
-#ifdef DEBUG
-       dev_dbg(&pcid->dev,
-               "after get pci_info memaddr is %x, io addr is %x,io_size is %d\n",
-               priv->memaddr, priv->ioaddr, priv->io_size);
-       {
-               int i;
-               u32 bar, len;
-               u32 address[] = {
-                       PCI_BASE_ADDRESS_0,
-                       PCI_BASE_ADDRESS_1,
-                       PCI_BASE_ADDRESS_2,
-                       PCI_BASE_ADDRESS_3,
-                       PCI_BASE_ADDRESS_4,
-                       PCI_BASE_ADDRESS_5,
-                       0};
-               for (i = 0; address[i]; i++) {
-                       pci_read_config_dword(pcid, address[i], &bar);
-
-                       dev_dbg(&pcid->dev, "bar %d is %x\n", i, bar);
-
-                       if (!bar) {
-                               dev_dbg(&pcid->dev,
-                                       "bar %d not implemented\n", i);
-                               continue;
-                       }
-
-                       if (bar & PCI_BASE_ADDRESS_SPACE_IO) {
-                               /* This is IO */
-
-                               len = bar & (PCI_BASE_ADDRESS_IO_MASK & 0xffff);
-                               len = len & ~(len - 1);
-
-                               dev_dbg(&pcid->dev,
-                                       "IO space:  len in IO %x, BAR %d\n",
-                                       len, i);
-                       } else {
-                               len = bar & 0xfffffff0;
-                               len = ~len + 1;
-
-                               dev_dbg(&pcid->dev,
-                                       "len in MEM %x, BAR %d\n", len, i);
-                       }
-               }
-       }
-#endif
-
        priv->PortOffset = ioremap(priv->memaddr & PCI_BASE_ADDRESS_MEM_MASK,
-                                  priv->io_size);
+                                  256);
        if (!priv->PortOffset) {
                dev_err(&pcid->dev, ": Failed to IO remapping ..\n");
                device_free_info(priv);
@@ -1779,11 +1707,6 @@ vt6655_probe(struct pci_dev *pcid, const struct pci_device_id *ent)
 
        device_get_options(priv);
        device_set_options(priv);
-       /* Mask out the options cannot be set to the chip */
-       priv->sOpts.flags &= pChip_info->flags;
-
-       /* Enable the chip specified capabilities */
-       priv->flags = priv->sOpts.flags | (pChip_info->flags & 0xff000000UL);
 
        wiphy = priv->hw->wiphy;