From patchwork Sat Sep 12 18:10:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Malcolm Priestley X-Patchwork-Id: 7167091 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 75D4B9F1D3 for ; Sat, 12 Sep 2015 18:11:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5D2D120723 for ; Sat, 12 Sep 2015 18:11:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 47929206F7 for ; Sat, 12 Sep 2015 18:11:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754386AbbILSL1 (ORCPT ); Sat, 12 Sep 2015 14:11:27 -0400 Received: from mail-wi0-f182.google.com ([209.85.212.182]:33520 "EHLO mail-wi0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751915AbbILSLH (ORCPT ); Sat, 12 Sep 2015 14:11:07 -0400 Received: by wiclk2 with SMTP id lk2so96487273wic.0 for ; Sat, 12 Sep 2015 11:11:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=4k0JJuVe9Liw9MFAPkoYbSjaZ6B2b/CDElKLMIl498U=; b=yw/rWAEFWOnjIXMEB4u94CQXqKowYJr2YRcsU9EoFNS9eKd2FYEv9VcfAgDwZrpk5W oUDKDoYg3nGbYkv/bxYIslCFjV5/nc/U3jvweabtK1OISYjxzDkkE9em5U5jvBj7boSH sjbmYXoxA92067PbmDfE5mL1Iy2C6FM8RjhfdsIW31+eljcbJLjQsOIp0xVqjHEQ0fwx kIsOqQkLODxNmz9aUfQGJrQG1o2k20HHvug27wntlS+s+S9I2+XzdCKYH3QlmT8CW/0f K7XY0U8g9aarsFKVPEUd8XrsKi7v/psUl5R+pB7ek6YlwQ02rEmUyRhCsoTkqwfj6RZ1 GU+Q== X-Received: by 10.194.191.164 with SMTP id gz4mr9919498wjc.21.1442081466355; Sat, 12 Sep 2015 11:11:06 -0700 (PDT) Received: from tipsey.3.home (188.31.129.159.threembb.co.uk. [188.31.129.159]) by smtp.gmail.com with ESMTPSA id c3sm6628188wja.3.2015.09.12.11.11.05 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 12 Sep 2015 11:11:05 -0700 (PDT) From: Malcolm Priestley To: gregkh@linuxfoundation.org Cc: linux-wireless@vger.kernel.org, Malcolm Priestley Subject: [PATCH 03/11] staging: vt6655: Remove typedef struct __chip_info_tbl Date: Sat, 12 Sep 2015 19:10:30 +0100 Message-Id: <1442081438-3485-3-git-send-email-tvboxspy@gmail.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1442081438-3485-1-git-send-email-tvboxspy@gmail.com> References: <1442081438-3485-1-git-send-email-tvboxspy@gmail.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Only two values that are assigned from this table. DEVICE_FLAGS_TX_ALIGN and the value of io_size which is used as the size of ioremap which is 256. Remove all variables, DEVICE_FLAGS_TX_ALIGN check, apply io_size value and chip_info_table. Signed-off-by: Malcolm Priestley --- drivers/staging/vt6655/device.h | 12 ----------- drivers/staging/vt6655/device_main.c | 40 ++++++++++-------------------------- 2 files changed, 11 insertions(+), 41 deletions(-) diff --git a/drivers/staging/vt6655/device.h b/drivers/staging/vt6655/device.h index d1917d0..be42e44 100644 --- a/drivers/staging/vt6655/device.h +++ b/drivers/staging/vt6655/device.h @@ -157,14 +157,6 @@ #define PK_TYPE_11GB 2 #define PK_TYPE_11GA 3 -typedef struct __chip_info_tbl { - CHIP_TYPE chip_id; - char *name; - int io_size; - int nTxQueue; - u32 flags; -} CHIP_INFO, *PCHIP_INFO; - typedef enum { OWNED_BY_HOST = 0, OWNED_BY_NIC = 1 @@ -235,12 +227,9 @@ struct vnt_private { unsigned char *tx1_bufs; unsigned char *tx_beacon_bufs; - CHIP_TYPE chip_id; - void __iomem *PortOffset; u32 memaddr; u32 ioaddr; - u32 io_size; unsigned char byRevId; unsigned char byRxMode; @@ -249,7 +238,6 @@ struct vnt_private { spinlock_t lock; - int nTxQueues; volatile int iTDUsed[TYPE_MAXTD]; struct vnt_tx_desc *apCurrTD[TYPE_MAXTD]; diff --git a/drivers/staging/vt6655/device_main.c b/drivers/staging/vt6655/device_main.c index 99191d9..4bc9ba0 100644 --- a/drivers/staging/vt6655/device_main.c +++ b/drivers/staging/vt6655/device_main.c @@ -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); @@ -443,15 +437,11 @@ static void device_print_info(struct vnt_private *pDevice) } 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)); @@ -695,10 +685,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)); } @@ -721,10 +710,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)); } @@ -1640,7 +1628,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; @@ -1660,7 +1647,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; @@ -1681,7 +1668,7 @@ vt6655_probe(struct pci_dev *pcid, const struct pci_device_id *ent) } 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); @@ -1721,11 +1708,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;