Commit 316343e2 authored by Linus Torvalds's avatar Linus Torvalds

Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6:
  bnx2x: Accessing un-mapped page
  ath9k: Fix TX control flag use for no ACK and RTS/CTS
  ath9k: Fix TX status reporting
  iwlwifi: fix STATUS_EXIT_PENDING is not set on pci_remove
  iwlwifi: call apm stop on exit
  iwlwifi: fix Tx cmd memory allocation failure handling
  iwlwifi: fix rx_chain computation
  iwlwifi: fix station mimo power save values
  iwlwifi: remove false rxon if rx chain changes
  iwlwifi: fix hidden ssid discovery in passive channels
  iwlwifi: W/A for the TSF correction in IBSS
  netxen: Remove workaround for chipset quirk
  pcnet-cs, axnet_cs: add new IDs, remove dup ID with less info
  ixgbe: initialize interrupt throttle rate
  net/usb/pegasus: avoid hundreds of diagnostics
  tipc: Don't use structure names which easily globally conflict.
parents ec0c15af fca1287a
...@@ -151,6 +151,8 @@ struct sw_rx_page { ...@@ -151,6 +151,8 @@ struct sw_rx_page {
#define PAGES_PER_SGE_SHIFT 0 #define PAGES_PER_SGE_SHIFT 0
#define PAGES_PER_SGE (1 << PAGES_PER_SGE_SHIFT) #define PAGES_PER_SGE (1 << PAGES_PER_SGE_SHIFT)
#define BCM_RX_ETH_PAYLOAD_ALIGN 64
/* SGE ring related macros */ /* SGE ring related macros */
#define NUM_RX_SGE_PAGES 2 #define NUM_RX_SGE_PAGES 2
#define RX_SGE_CNT (BCM_PAGE_SIZE / sizeof(struct eth_rx_sge)) #define RX_SGE_CNT (BCM_PAGE_SIZE / sizeof(struct eth_rx_sge))
...@@ -750,8 +752,7 @@ struct bnx2x { ...@@ -750,8 +752,7 @@ struct bnx2x {
u32 rx_csum; u32 rx_csum;
u32 rx_offset; u32 rx_offset;
u32 rx_buf_use_size; /* useable size */ u32 rx_buf_size;
u32 rx_buf_size; /* with alignment */
#define ETH_OVREHEAD (ETH_HLEN + 8) /* 8 for CRC + VLAN */ #define ETH_OVREHEAD (ETH_HLEN + 8) /* 8 for CRC + VLAN */
#define ETH_MIN_PACKET_SIZE 60 #define ETH_MIN_PACKET_SIZE 60
#define ETH_MAX_PACKET_SIZE 1500 #define ETH_MAX_PACKET_SIZE 1500
......
...@@ -59,8 +59,8 @@ ...@@ -59,8 +59,8 @@
#include "bnx2x.h" #include "bnx2x.h"
#include "bnx2x_init.h" #include "bnx2x_init.h"
#define DRV_MODULE_VERSION "1.45.20" #define DRV_MODULE_VERSION "1.45.21"
#define DRV_MODULE_RELDATE "2008/08/25" #define DRV_MODULE_RELDATE "2008/09/03"
#define BNX2X_BC_VER 0x040200 #define BNX2X_BC_VER 0x040200
/* Time in jiffies before concluding the transmitter is hung */ /* Time in jiffies before concluding the transmitter is hung */
...@@ -1027,7 +1027,7 @@ static inline int bnx2x_alloc_rx_skb(struct bnx2x *bp, ...@@ -1027,7 +1027,7 @@ static inline int bnx2x_alloc_rx_skb(struct bnx2x *bp,
if (unlikely(skb == NULL)) if (unlikely(skb == NULL))
return -ENOMEM; return -ENOMEM;
mapping = pci_map_single(bp->pdev, skb->data, bp->rx_buf_use_size, mapping = pci_map_single(bp->pdev, skb->data, bp->rx_buf_size,
PCI_DMA_FROMDEVICE); PCI_DMA_FROMDEVICE);
if (unlikely(dma_mapping_error(&bp->pdev->dev, mapping))) { if (unlikely(dma_mapping_error(&bp->pdev->dev, mapping))) {
dev_kfree_skb(skb); dev_kfree_skb(skb);
...@@ -1169,7 +1169,7 @@ static void bnx2x_tpa_start(struct bnx2x_fastpath *fp, u16 queue, ...@@ -1169,7 +1169,7 @@ static void bnx2x_tpa_start(struct bnx2x_fastpath *fp, u16 queue,
/* move empty skb from pool to prod and map it */ /* move empty skb from pool to prod and map it */
prod_rx_buf->skb = fp->tpa_pool[queue].skb; prod_rx_buf->skb = fp->tpa_pool[queue].skb;
mapping = pci_map_single(bp->pdev, fp->tpa_pool[queue].skb->data, mapping = pci_map_single(bp->pdev, fp->tpa_pool[queue].skb->data,
bp->rx_buf_use_size, PCI_DMA_FROMDEVICE); bp->rx_buf_size, PCI_DMA_FROMDEVICE);
pci_unmap_addr_set(prod_rx_buf, mapping, mapping); pci_unmap_addr_set(prod_rx_buf, mapping, mapping);
/* move partial skb from cons to pool (don't unmap yet) */ /* move partial skb from cons to pool (don't unmap yet) */
...@@ -1276,7 +1276,7 @@ static void bnx2x_tpa_stop(struct bnx2x *bp, struct bnx2x_fastpath *fp, ...@@ -1276,7 +1276,7 @@ static void bnx2x_tpa_stop(struct bnx2x *bp, struct bnx2x_fastpath *fp,
pool entry status to BNX2X_TPA_STOP even if new skb allocation pool entry status to BNX2X_TPA_STOP even if new skb allocation
fails. */ fails. */
pci_unmap_single(bp->pdev, pci_unmap_addr(rx_buf, mapping), pci_unmap_single(bp->pdev, pci_unmap_addr(rx_buf, mapping),
bp->rx_buf_use_size, PCI_DMA_FROMDEVICE); bp->rx_buf_size, PCI_DMA_FROMDEVICE);
if (likely(new_skb)) { if (likely(new_skb)) {
/* fix ip xsum and give it to the stack */ /* fix ip xsum and give it to the stack */
...@@ -1520,7 +1520,7 @@ static int bnx2x_rx_int(struct bnx2x_fastpath *fp, int budget) ...@@ -1520,7 +1520,7 @@ static int bnx2x_rx_int(struct bnx2x_fastpath *fp, int budget)
} else if (bnx2x_alloc_rx_skb(bp, fp, bd_prod) == 0) { } else if (bnx2x_alloc_rx_skb(bp, fp, bd_prod) == 0) {
pci_unmap_single(bp->pdev, pci_unmap_single(bp->pdev,
pci_unmap_addr(rx_buf, mapping), pci_unmap_addr(rx_buf, mapping),
bp->rx_buf_use_size, bp->rx_buf_size,
PCI_DMA_FROMDEVICE); PCI_DMA_FROMDEVICE);
skb_reserve(skb, pad); skb_reserve(skb, pad);
skb_put(skb, len); skb_put(skb, len);
...@@ -4229,7 +4229,7 @@ static inline void bnx2x_free_tpa_pool(struct bnx2x *bp, ...@@ -4229,7 +4229,7 @@ static inline void bnx2x_free_tpa_pool(struct bnx2x *bp,
if (fp->tpa_state[i] == BNX2X_TPA_START) if (fp->tpa_state[i] == BNX2X_TPA_START)
pci_unmap_single(bp->pdev, pci_unmap_single(bp->pdev,
pci_unmap_addr(rx_buf, mapping), pci_unmap_addr(rx_buf, mapping),
bp->rx_buf_use_size, bp->rx_buf_size,
PCI_DMA_FROMDEVICE); PCI_DMA_FROMDEVICE);
dev_kfree_skb(skb); dev_kfree_skb(skb);
...@@ -4245,15 +4245,14 @@ static void bnx2x_init_rx_rings(struct bnx2x *bp) ...@@ -4245,15 +4245,14 @@ static void bnx2x_init_rx_rings(struct bnx2x *bp)
u16 ring_prod, cqe_ring_prod; u16 ring_prod, cqe_ring_prod;
int i, j; int i, j;
bp->rx_buf_use_size = bp->dev->mtu; bp->rx_buf_size = bp->dev->mtu;
bp->rx_buf_use_size += bp->rx_offset + ETH_OVREHEAD; bp->rx_buf_size += bp->rx_offset + ETH_OVREHEAD +
bp->rx_buf_size = bp->rx_buf_use_size + 64; BCM_RX_ETH_PAYLOAD_ALIGN;
if (bp->flags & TPA_ENABLE_FLAG) { if (bp->flags & TPA_ENABLE_FLAG) {
DP(NETIF_MSG_IFUP, DP(NETIF_MSG_IFUP,
"rx_buf_use_size %d rx_buf_size %d effective_mtu %d\n", "rx_buf_size %d effective_mtu %d\n",
bp->rx_buf_use_size, bp->rx_buf_size, bp->rx_buf_size, bp->dev->mtu + ETH_OVREHEAD);
bp->dev->mtu + ETH_OVREHEAD);
for_each_queue(bp, j) { for_each_queue(bp, j) {
struct bnx2x_fastpath *fp = &bp->fp[j]; struct bnx2x_fastpath *fp = &bp->fp[j];
...@@ -4462,9 +4461,10 @@ static void bnx2x_init_context(struct bnx2x *bp) ...@@ -4462,9 +4461,10 @@ static void bnx2x_init_context(struct bnx2x *bp)
context->ustorm_st_context.common.status_block_id = sb_id; context->ustorm_st_context.common.status_block_id = sb_id;
context->ustorm_st_context.common.flags = context->ustorm_st_context.common.flags =
USTORM_ETH_ST_CONTEXT_CONFIG_ENABLE_MC_ALIGNMENT; USTORM_ETH_ST_CONTEXT_CONFIG_ENABLE_MC_ALIGNMENT;
context->ustorm_st_context.common.mc_alignment_size = 64; context->ustorm_st_context.common.mc_alignment_size =
BCM_RX_ETH_PAYLOAD_ALIGN;
context->ustorm_st_context.common.bd_buff_size = context->ustorm_st_context.common.bd_buff_size =
bp->rx_buf_use_size; bp->rx_buf_size;
context->ustorm_st_context.common.bd_page_base_hi = context->ustorm_st_context.common.bd_page_base_hi =
U64_HI(fp->rx_desc_mapping); U64_HI(fp->rx_desc_mapping);
context->ustorm_st_context.common.bd_page_base_lo = context->ustorm_st_context.common.bd_page_base_lo =
...@@ -4717,7 +4717,7 @@ static void bnx2x_init_internal_func(struct bnx2x *bp) ...@@ -4717,7 +4717,7 @@ static void bnx2x_init_internal_func(struct bnx2x *bp)
} }
/* Init CQ ring mapping and aggregation size */ /* Init CQ ring mapping and aggregation size */
max_agg_size = min((u32)(bp->rx_buf_use_size + max_agg_size = min((u32)(bp->rx_buf_size +
8*BCM_PAGE_SIZE*PAGES_PER_SGE), 8*BCM_PAGE_SIZE*PAGES_PER_SGE),
(u32)0xffff); (u32)0xffff);
for_each_queue(bp, i) { for_each_queue(bp, i) {
...@@ -5940,7 +5940,7 @@ static void bnx2x_free_rx_skbs(struct bnx2x *bp) ...@@ -5940,7 +5940,7 @@ static void bnx2x_free_rx_skbs(struct bnx2x *bp)
pci_unmap_single(bp->pdev, pci_unmap_single(bp->pdev,
pci_unmap_addr(rx_buf, mapping), pci_unmap_addr(rx_buf, mapping),
bp->rx_buf_use_size, bp->rx_buf_size,
PCI_DMA_FROMDEVICE); PCI_DMA_FROMDEVICE);
rx_buf->skb = NULL; rx_buf->skb = NULL;
......
...@@ -2303,6 +2303,12 @@ static int __devinit ixgbe_set_interrupt_capability(struct ixgbe_adapter ...@@ -2303,6 +2303,12 @@ static int __devinit ixgbe_set_interrupt_capability(struct ixgbe_adapter
int err = 0; int err = 0;
int vector, v_budget; int vector, v_budget;
/*
* Set the default interrupt throttle rate.
*/
adapter->rx_eitr = (1000000 / IXGBE_DEFAULT_ITR_RX_USECS);
adapter->tx_eitr = (1000000 / IXGBE_DEFAULT_ITR_TX_USECS);
/* /*
* It's easy to be greedy for MSI-X vectors, but it really * It's easy to be greedy for MSI-X vectors, but it really
* doesn't do us much good if we have a lot more vectors * doesn't do us much good if we have a lot more vectors
......
...@@ -359,16 +359,6 @@ static void netxen_pcie_strap_init(struct netxen_adapter *adapter) ...@@ -359,16 +359,6 @@ static void netxen_pcie_strap_init(struct netxen_adapter *adapter)
int i, pos; int i, pos;
struct pci_dev *pdev; struct pci_dev *pdev;
pdev = pci_get_device(0x1166, 0x0140, NULL);
if (pdev) {
pci_dev_put(pdev);
adapter->hw_read_wx(adapter,
NETXEN_PCIE_REG(PCIE_TGT_SPLIT_CHICKEN), &chicken, 4);
chicken |= 0x4000;
adapter->hw_write_wx(adapter,
NETXEN_PCIE_REG(PCIE_TGT_SPLIT_CHICKEN), &chicken, 4);
}
pdev = adapter->pdev; pdev = adapter->pdev;
adapter->hw_read_wx(adapter, adapter->hw_read_wx(adapter,
......
...@@ -784,6 +784,7 @@ static struct pcmcia_device_id axnet_ids[] = { ...@@ -784,6 +784,7 @@ static struct pcmcia_device_id axnet_ids[] = {
PCMCIA_DEVICE_PROD_ID12("corega K.K.", "corega FEther PCC-TXD", 0x5261440f, 0x436768c5), PCMCIA_DEVICE_PROD_ID12("corega K.K.", "corega FEther PCC-TXD", 0x5261440f, 0x436768c5),
PCMCIA_DEVICE_PROD_ID12("corega K.K.", "corega FEtherII PCC-TXD", 0x5261440f, 0x730df72e), PCMCIA_DEVICE_PROD_ID12("corega K.K.", "corega FEtherII PCC-TXD", 0x5261440f, 0x730df72e),
PCMCIA_DEVICE_PROD_ID12("Dynalink", "L100C16", 0x55632fd5, 0x66bc2a90), PCMCIA_DEVICE_PROD_ID12("Dynalink", "L100C16", 0x55632fd5, 0x66bc2a90),
PCMCIA_DEVICE_PROD_ID12("IO DATA", "ETXPCM", 0x547e66dc, 0x233adac2),
PCMCIA_DEVICE_PROD_ID12("Linksys", "EtherFast 10/100 PC Card (PCMPC100 V3)", 0x0733cc81, 0x232019a8), PCMCIA_DEVICE_PROD_ID12("Linksys", "EtherFast 10/100 PC Card (PCMPC100 V3)", 0x0733cc81, 0x232019a8),
PCMCIA_DEVICE_PROD_ID12("MELCO", "LPC3-TX", 0x481e0094, 0xf91af609), PCMCIA_DEVICE_PROD_ID12("MELCO", "LPC3-TX", 0x481e0094, 0xf91af609),
PCMCIA_DEVICE_PROD_ID12("PCMCIA", "100BASE", 0x281f1c5d, 0x7c2add04), PCMCIA_DEVICE_PROD_ID12("PCMCIA", "100BASE", 0x281f1c5d, 0x7c2add04),
......
...@@ -1626,6 +1626,7 @@ static struct pcmcia_device_id pcnet_ids[] = { ...@@ -1626,6 +1626,7 @@ static struct pcmcia_device_id pcnet_ids[] = {
PCMCIA_DEVICE_PROD_ID12("corega K.K.", "corega EtherII PCC-TD", 0x5261440f, 0xc49bd73d), PCMCIA_DEVICE_PROD_ID12("corega K.K.", "corega EtherII PCC-TD", 0x5261440f, 0xc49bd73d),
PCMCIA_DEVICE_PROD_ID12("Corega K.K.", "corega EtherII PCC-TD", 0xd4fdcbd8, 0xc49bd73d), PCMCIA_DEVICE_PROD_ID12("Corega K.K.", "corega EtherII PCC-TD", 0xd4fdcbd8, 0xc49bd73d),
PCMCIA_DEVICE_PROD_ID12("corega K.K.", "corega Ether PCC-T", 0x5261440f, 0x6705fcaa), PCMCIA_DEVICE_PROD_ID12("corega K.K.", "corega Ether PCC-T", 0x5261440f, 0x6705fcaa),
PCMCIA_DEVICE_PROD_ID12("corega K.K.", "corega Ether PCC-TD", 0x5261440f, 0x47d5ca83),
PCMCIA_DEVICE_PROD_ID12("corega K.K.", "corega FastEther PCC-TX", 0x5261440f, 0x485e85d9), PCMCIA_DEVICE_PROD_ID12("corega K.K.", "corega FastEther PCC-TX", 0x5261440f, 0x485e85d9),
PCMCIA_DEVICE_PROD_ID12("Corega,K.K.", "Ethernet LAN Card", 0x110d26d9, 0x9fd2f0a2), PCMCIA_DEVICE_PROD_ID12("Corega,K.K.", "Ethernet LAN Card", 0x110d26d9, 0x9fd2f0a2),
PCMCIA_DEVICE_PROD_ID12("corega,K.K.", "Ethernet LAN Card", 0x9791a90e, 0x9fd2f0a2), PCMCIA_DEVICE_PROD_ID12("corega,K.K.", "Ethernet LAN Card", 0x9791a90e, 0x9fd2f0a2),
...@@ -1737,7 +1738,6 @@ static struct pcmcia_device_id pcnet_ids[] = { ...@@ -1737,7 +1738,6 @@ static struct pcmcia_device_id pcnet_ids[] = {
PCMCIA_DEVICE_PROD_ID1("CyQ've 10 Base-T LAN CARD", 0x94faf360), PCMCIA_DEVICE_PROD_ID1("CyQ've 10 Base-T LAN CARD", 0x94faf360),
PCMCIA_DEVICE_PROD_ID1("EP-210 PCMCIA LAN CARD.", 0x8850b4de), PCMCIA_DEVICE_PROD_ID1("EP-210 PCMCIA LAN CARD.", 0x8850b4de),
PCMCIA_DEVICE_PROD_ID1("ETHER-C16", 0x06a8514f), PCMCIA_DEVICE_PROD_ID1("ETHER-C16", 0x06a8514f),
PCMCIA_DEVICE_PROD_ID1("IC-CARD", 0x60cb09a6),
PCMCIA_DEVICE_PROD_ID1("NE2000 Compatible", 0x75b8ad5a), PCMCIA_DEVICE_PROD_ID1("NE2000 Compatible", 0x75b8ad5a),
PCMCIA_DEVICE_PROD_ID2("EN-6200P2", 0xa996d078), PCMCIA_DEVICE_PROD_ID2("EN-6200P2", 0xa996d078),
/* too generic! */ /* too generic! */
......
...@@ -117,7 +117,7 @@ static void ctrl_callback(struct urb *urb) ...@@ -117,7 +117,7 @@ static void ctrl_callback(struct urb *urb)
case -ENOENT: case -ENOENT:
break; break;
default: default:
if (netif_msg_drv(pegasus)) if (netif_msg_drv(pegasus) && printk_ratelimit())
dev_dbg(&pegasus->intf->dev, "%s, status %d\n", dev_dbg(&pegasus->intf->dev, "%s, status %d\n",
__FUNCTION__, urb->status); __FUNCTION__, urb->status);
} }
...@@ -166,7 +166,7 @@ static int get_registers(pegasus_t * pegasus, __u16 indx, __u16 size, ...@@ -166,7 +166,7 @@ static int get_registers(pegasus_t * pegasus, __u16 indx, __u16 size,
set_current_state(TASK_RUNNING); set_current_state(TASK_RUNNING);
if (ret == -ENODEV) if (ret == -ENODEV)
netif_device_detach(pegasus->net); netif_device_detach(pegasus->net);
if (netif_msg_drv(pegasus)) if (netif_msg_drv(pegasus) && printk_ratelimit())
dev_err(&pegasus->intf->dev, "%s, status %d\n", dev_err(&pegasus->intf->dev, "%s, status %d\n",
__FUNCTION__, ret); __FUNCTION__, ret);
goto out; goto out;
...@@ -275,7 +275,7 @@ static int set_register(pegasus_t * pegasus, __u16 indx, __u8 data) ...@@ -275,7 +275,7 @@ static int set_register(pegasus_t * pegasus, __u16 indx, __u8 data)
if ((ret = usb_submit_urb(pegasus->ctrl_urb, GFP_ATOMIC))) { if ((ret = usb_submit_urb(pegasus->ctrl_urb, GFP_ATOMIC))) {
if (ret == -ENODEV) if (ret == -ENODEV)
netif_device_detach(pegasus->net); netif_device_detach(pegasus->net);
if (netif_msg_drv(pegasus)) if (netif_msg_drv(pegasus) && printk_ratelimit())
dev_err(&pegasus->intf->dev, "%s, status %d\n", dev_err(&pegasus->intf->dev, "%s, status %d\n",
__FUNCTION__, ret); __FUNCTION__, ret);
goto out; goto out;
...@@ -1209,8 +1209,7 @@ static void pegasus_set_multicast(struct net_device *net) ...@@ -1209,8 +1209,7 @@ static void pegasus_set_multicast(struct net_device *net)
pegasus->eth_regs[EthCtrl2] |= RX_PROMISCUOUS; pegasus->eth_regs[EthCtrl2] |= RX_PROMISCUOUS;
if (netif_msg_link(pegasus)) if (netif_msg_link(pegasus))
pr_info("%s: Promiscuous mode enabled.\n", net->name); pr_info("%s: Promiscuous mode enabled.\n", net->name);
} else if (net->mc_count || } else if (net->mc_count || (net->flags & IFF_ALLMULTI)) {
(net->flags & IFF_ALLMULTI)) {
pegasus->eth_regs[EthCtrl0] |= RX_MULTICAST; pegasus->eth_regs[EthCtrl0] |= RX_MULTICAST;
pegasus->eth_regs[EthCtrl2] &= ~RX_PROMISCUOUS; pegasus->eth_regs[EthCtrl2] &= ~RX_PROMISCUOUS;
if (netif_msg_link(pegasus)) if (netif_msg_link(pegasus))
...@@ -1220,6 +1219,8 @@ static void pegasus_set_multicast(struct net_device *net) ...@@ -1220,6 +1219,8 @@ static void pegasus_set_multicast(struct net_device *net)
pegasus->eth_regs[EthCtrl2] &= ~RX_PROMISCUOUS; pegasus->eth_regs[EthCtrl2] &= ~RX_PROMISCUOUS;
} }
pegasus->ctrl_urb->status = 0;
pegasus->flags |= ETH_REGS_CHANGE; pegasus->flags |= ETH_REGS_CHANGE;
ctrl_callback(pegasus->ctrl_urb); ctrl_callback(pegasus->ctrl_urb);
} }
......
...@@ -1067,8 +1067,16 @@ void ath_tx_complete(struct ath_softc *sc, struct sk_buff *skb, ...@@ -1067,8 +1067,16 @@ void ath_tx_complete(struct ath_softc *sc, struct sk_buff *skb,
tx_info->flags |= IEEE80211_TX_STAT_AMPDU_NO_BACK; tx_info->flags |= IEEE80211_TX_STAT_AMPDU_NO_BACK;
tx_status->flags &= ~ATH_TX_BAR; tx_status->flags &= ~ATH_TX_BAR;
} }
if (tx_status->flags)
tx_info->status.excessive_retries = 1; if (tx_status->flags & (ATH_TX_ERROR | ATH_TX_XRETRY)) {
if (!(tx_info->flags & IEEE80211_TX_CTL_NO_ACK)) {
/* Frame was not ACKed, but an ACK was expected */
tx_info->status.excessive_retries = 1;
}
} else {
/* Frame was ACKed */
tx_info->flags |= IEEE80211_TX_STAT_ACK;
}
tx_info->status.retry_count = tx_status->retries; tx_info->status.retry_count = tx_status->retries;
......
...@@ -357,9 +357,9 @@ static int ath_tx_prepare(struct ath_softc *sc, ...@@ -357,9 +357,9 @@ static int ath_tx_prepare(struct ath_softc *sc,
txctl->flags = ATH9K_TXDESC_CLRDMASK; /* needed for crypto errors */ txctl->flags = ATH9K_TXDESC_CLRDMASK; /* needed for crypto errors */
if (tx_info->flags & IEEE80211_TX_CTL_NO_ACK) if (tx_info->flags & IEEE80211_TX_CTL_NO_ACK)
tx_info->flags |= ATH9K_TXDESC_NOACK; txctl->flags |= ATH9K_TXDESC_NOACK;
if (tx_info->flags & IEEE80211_TX_CTL_USE_RTS_CTS) if (tx_info->flags & IEEE80211_TX_CTL_USE_RTS_CTS)
tx_info->flags |= ATH9K_TXDESC_RTSENA; txctl->flags |= ATH9K_TXDESC_RTSENA;
/* /*
* Setup for rate calculations. * Setup for rate calculations.
......
...@@ -1153,7 +1153,8 @@ static int rs_switch_to_mimo2(struct iwl_priv *priv, ...@@ -1153,7 +1153,8 @@ static int rs_switch_to_mimo2(struct iwl_priv *priv,
!sta->ht_info.ht_supported) !sta->ht_info.ht_supported)
return -1; return -1;
if (priv->current_ht_config.tx_mimo_ps_mode == IWL_MIMO_PS_STATIC) if (((sta->ht_info.cap & IEEE80211_HT_CAP_MIMO_PS) >> 2)
== IWL_MIMO_PS_STATIC)
return -1; return -1;
/* Need both Tx chains/antennas to support MIMO */ /* Need both Tx chains/antennas to support MIMO */
......
...@@ -181,14 +181,14 @@ static int iwl4965_check_rxon_cmd(struct iwl_rxon_cmd *rxon) ...@@ -181,14 +181,14 @@ static int iwl4965_check_rxon_cmd(struct iwl_rxon_cmd *rxon)
} }
/** /**
* iwl4965_full_rxon_required - check if full RXON (vs RXON_ASSOC) cmd is needed * iwl_full_rxon_required - check if full RXON (vs RXON_ASSOC) cmd is needed
* @priv: staging_rxon is compared to active_rxon * @priv: staging_rxon is compared to active_rxon
* *
* If the RXON structure is changing enough to require a new tune, * If the RXON structure is changing enough to require a new tune,
* or is clearing the RXON_FILTER_ASSOC_MSK, then return 1 to indicate that * or is clearing the RXON_FILTER_ASSOC_MSK, then return 1 to indicate that
* a new tune (full RXON command, rather than RXON_ASSOC cmd) is required. * a new tune (full RXON command, rather than RXON_ASSOC cmd) is required.
*/ */
static int iwl4965_full_rxon_required(struct iwl_priv *priv) static int iwl_full_rxon_required(struct iwl_priv *priv)
{ {
/* These items are only settable from the full RXON command */ /* These items are only settable from the full RXON command */
...@@ -207,7 +207,6 @@ static int iwl4965_full_rxon_required(struct iwl_priv *priv) ...@@ -207,7 +207,6 @@ static int iwl4965_full_rxon_required(struct iwl_priv *priv)
priv->active_rxon.ofdm_ht_single_stream_basic_rates) || priv->active_rxon.ofdm_ht_single_stream_basic_rates) ||
(priv->staging_rxon.ofdm_ht_dual_stream_basic_rates != (priv->staging_rxon.ofdm_ht_dual_stream_basic_rates !=
priv->active_rxon.ofdm_ht_dual_stream_basic_rates) || priv->active_rxon.ofdm_ht_dual_stream_basic_rates) ||
(priv->staging_rxon.rx_chain != priv->active_rxon.rx_chain) ||
(priv->staging_rxon.assoc_id != priv->active_rxon.assoc_id)) (priv->staging_rxon.assoc_id != priv->active_rxon.assoc_id))
return 1; return 1;
...@@ -263,7 +262,7 @@ static int iwl4965_commit_rxon(struct iwl_priv *priv) ...@@ -263,7 +262,7 @@ static int iwl4965_commit_rxon(struct iwl_priv *priv)
/* If we don't need to send a full RXON, we can use /* If we don't need to send a full RXON, we can use
* iwl4965_rxon_assoc_cmd which is used to reconfigure filter * iwl4965_rxon_assoc_cmd which is used to reconfigure filter
* and other flags for the current radio configuration. */ * and other flags for the current radio configuration. */
if (!iwl4965_full_rxon_required(priv)) { if (!iwl_full_rxon_required(priv)) {
ret = iwl_send_rxon_assoc(priv); ret = iwl_send_rxon_assoc(priv);
if (ret) { if (ret) {
IWL_ERROR("Error setting RXON_ASSOC (%d)\n", ret); IWL_ERROR("Error setting RXON_ASSOC (%d)\n", ret);
...@@ -587,8 +586,6 @@ static void iwl4965_ht_conf(struct iwl_priv *priv, ...@@ -587,8 +586,6 @@ static void iwl4965_ht_conf(struct iwl_priv *priv,
iwl_conf->supported_chan_width = 0; iwl_conf->supported_chan_width = 0;
} }
iwl_conf->tx_mimo_ps_mode =
(u8)((ht_conf->cap & IEEE80211_HT_CAP_MIMO_PS) >> 2);
memcpy(iwl_conf->supp_mcs_set, ht_conf->supp_mcs_set, 16); memcpy(iwl_conf->supp_mcs_set, ht_conf->supp_mcs_set, 16);
iwl_conf->control_channel = ht_bss_conf->primary_channel; iwl_conf->control_channel = ht_bss_conf->primary_channel;
...@@ -2190,7 +2187,10 @@ static void __iwl4965_down(struct iwl_priv *priv) ...@@ -2190,7 +2187,10 @@ static void __iwl4965_down(struct iwl_priv *priv)
udelay(5); udelay(5);
/* FIXME: apm_ops.suspend(priv) */ /* FIXME: apm_ops.suspend(priv) */
priv->cfg->ops->lib->apm_ops.reset(priv); if (exit_pending || test_bit(STATUS_IN_SUSPEND, &priv->status))
priv->cfg->ops->lib->apm_ops.stop(priv);
else
priv->cfg->ops->lib->apm_ops.reset(priv);
priv->cfg->ops->lib->free_shared_mem(priv); priv->cfg->ops->lib->free_shared_mem(priv);
exit: exit:
...@@ -3588,7 +3588,7 @@ static int iwl4965_mac_beacon_update(struct ieee80211_hw *hw, struct sk_buff *sk ...@@ -3588,7 +3588,7 @@ static int iwl4965_mac_beacon_update(struct ieee80211_hw *hw, struct sk_buff *sk
priv->assoc_id = 0; priv->assoc_id = 0;
timestamp = ((struct ieee80211_mgmt *)skb->data)->u.beacon.timestamp; timestamp = ((struct ieee80211_mgmt *)skb->data)->u.beacon.timestamp;
priv->timestamp = le64_to_cpu(timestamp) + (priv->beacon_int * 1000); priv->timestamp = le64_to_cpu(timestamp);
IWL_DEBUG_MAC80211("leave\n"); IWL_DEBUG_MAC80211("leave\n");
spin_unlock_irqrestore(&priv->lock, flags); spin_unlock_irqrestore(&priv->lock, flags);
...@@ -4372,15 +4372,18 @@ static void __devexit iwl4965_pci_remove(struct pci_dev *pdev) ...@@ -4372,15 +4372,18 @@ static void __devexit iwl4965_pci_remove(struct pci_dev *pdev)
iwl_dbgfs_unregister(priv); iwl_dbgfs_unregister(priv);
sysfs_remove_group(&pdev->dev.kobj, &iwl4965_attribute_group); sysfs_remove_group(&pdev->dev.kobj, &iwl4965_attribute_group);
/* ieee80211_unregister_hw call wil cause iwl4965_mac_stop to
* to be called and iwl4965_down since we are removing the device
* we need to set STATUS_EXIT_PENDING bit.
*/
set_bit(STATUS_EXIT_PENDING, &priv->status);
if (priv->mac80211_registered) { if (priv->mac80211_registered) {
ieee80211_unregister_hw(priv->hw); ieee80211_unregister_hw(priv->hw);
priv->mac80211_registered = 0; priv->mac80211_registered = 0;
} else {
iwl4965_down(priv);
} }
set_bit(STATUS_EXIT_PENDING, &priv->status);
iwl4965_down(priv);
/* make sure we flush any pending irq or /* make sure we flush any pending irq or
* tasklet for the driver * tasklet for the driver
*/ */
......
...@@ -592,12 +592,11 @@ static void iwlcore_free_geos(struct iwl_priv *priv) ...@@ -592,12 +592,11 @@ static void iwlcore_free_geos(struct iwl_priv *priv)
clear_bit(STATUS_GEO_CONFIGURED, &priv->status); clear_bit(STATUS_GEO_CONFIGURED, &priv->status);
} }
static u8 is_single_rx_stream(struct iwl_priv *priv) static bool is_single_rx_stream(struct iwl_priv *priv)
{ {
return !priv->current_ht_config.is_ht || return !priv->current_ht_config.is_ht ||
((priv->current_ht_config.supp_mcs_set[1] == 0) && ((priv->current_ht_config.supp_mcs_set[1] == 0) &&
(priv->current_ht_config.supp_mcs_set[2] == 0)) || (priv->current_ht_config.supp_mcs_set[2] == 0));
priv->ps_mode == IWL_MIMO_PS_STATIC;
} }
static u8 iwl_is_channel_extension(struct iwl_priv *priv, static u8 iwl_is_channel_extension(struct iwl_priv *priv,
...@@ -704,33 +703,39 @@ EXPORT_SYMBOL(iwl_set_rxon_ht); ...@@ -704,33 +703,39 @@ EXPORT_SYMBOL(iwl_set_rxon_ht);
* MIMO (dual stream) requires at least 2, but works better with 3. * MIMO (dual stream) requires at least 2, but works better with 3.
* This does not determine *which* chains to use, just how many. * This does not determine *which* chains to use, just how many.
*/ */
static int iwlcore_get_rx_chain_counter(struct iwl_priv *priv, static int iwl_get_active_rx_chain_count(struct iwl_priv *priv)
u8 *idle_state, u8 *rx_state)
{ {
u8 is_single = is_single_rx_stream(priv); bool is_single = is_single_rx_stream(priv);
u8 is_cam = test_bit(STATUS_POWER_PMI, &priv->status) ? 0 : 1; bool is_cam = !test_bit(STATUS_POWER_PMI, &priv->status);
/* # of Rx chains to use when expecting MIMO. */ /* # of Rx chains to use when expecting MIMO. */
if (is_single || (!is_cam && (priv->ps_mode == IWL_MIMO_PS_STATIC))) if (is_single || (!is_cam && (priv->ps_mode == IWL_MIMO_PS_STATIC)))
*rx_state = 2; return 2;
else else
*rx_state = 3; return 3;
}
static int iwl_get_idle_rx_chain_count(struct iwl_priv *priv, int active_cnt)
{
int idle_cnt;
bool is_cam = !test_bit(STATUS_POWER_PMI, &priv->status);
/* # Rx chains when idling and maybe trying to save power */ /* # Rx chains when idling and maybe trying to save power */
switch (priv->ps_mode) { switch (priv->ps_mode) {
case IWL_MIMO_PS_STATIC: case IWL_MIMO_PS_STATIC:
case IWL_MIMO_PS_DYNAMIC: case IWL_MIMO_PS_DYNAMIC:
*idle_state = (is_cam) ? 2 : 1; idle_cnt = (is_cam) ? 2 : 1;
break; break;
case IWL_MIMO_PS_NONE: case IWL_MIMO_PS_NONE:
*idle_state = (is_cam) ? *rx_state : 1; idle_cnt = (is_cam) ? active_cnt : 1;
break; break;
case IWL_MIMO_PS_INVALID:
default: default:
*idle_state = 1; IWL_ERROR("invalide mimo ps mode %d\n", priv->ps_mode);
WARN_ON(1);
idle_cnt = -1;
break; break;
} }
return idle_cnt;
return 0;
} }
/** /**
...@@ -741,34 +746,44 @@ static int iwlcore_get_rx_chain_counter(struct iwl_priv *priv, ...@@ -741,34 +746,44 @@ static int iwlcore_get_rx_chain_counter(struct iwl_priv *priv,
*/ */
void iwl_set_rxon_chain(struct iwl_priv *priv) void iwl_set_rxon_chain(struct iwl_priv *priv)
{ {
u8 is_single = is_single_rx_stream(priv); bool is_single = is_single_rx_stream(priv);
u8 idle_state, rx_state; bool is_cam = !test_bit(STATUS_POWER_PMI, &priv->status);
u8 idle_rx_cnt, active_rx_cnt;
priv->staging_rxon.rx_chain = 0; u16 rx_chain;
rx_state = idle_state = 3;
/* Tell uCode which antennas are actually connected. /* Tell uCode which antennas are actually connected.
* Before first association, we assume all antennas are connected. * Before first association, we assume all antennas are connected.
* Just after first association, iwl_chain_noise_calibration() * Just after first association, iwl_chain_noise_calibration()
* checks which antennas actually *are* connected. */ * checks which antennas actually *are* connected. */
priv->staging_rxon.rx_chain |= rx_chain = priv->hw_params.valid_rx_ant << RXON_RX_CHAIN_VALID_POS;
cpu_to_le16(priv->hw_params.valid_rx_ant <<
RXON_RX_CHAIN_VALID_POS);
/* How many receivers should we use? */ /* How many receivers should we use? */
iwlcore_get_rx_chain_counter(priv, &idle_state, &rx_state); active_rx_cnt = iwl_get_active_rx_chain_count(priv);
priv->staging_rxon.rx_chain |= idle_rx_cnt = iwl_get_idle_rx_chain_count(priv, active_rx_cnt);
cpu_to_le16(rx_state << RXON_RX_CHAIN_MIMO_CNT_POS);
priv->staging_rxon.rx_chain |= /* correct rx chain count accoridng hw settings */
cpu_to_le16(idle_state << RXON_RX_CHAIN_CNT_POS); if (priv->hw_params.rx_chains_num < active_rx_cnt)
active_rx_cnt = priv->hw_params.rx_chains_num;
if (!is_single && (rx_state >= 2) &&
!test_bit(STATUS_POWER_PMI, &priv->status)) if (priv->hw_params.rx_chains_num < idle_rx_cnt)
idle_rx_cnt = priv->hw_params.rx_chains_num;
rx_chain |= active_rx_cnt << RXON_RX_CHAIN_MIMO_CNT_POS;
rx_chain |= idle_rx_cnt << RXON_RX_CHAIN_CNT_POS;
priv->staging_rxon.rx_chain = cpu_to_le16(rx_chain);
if (!is_single && (active_rx_cnt >= 2) && is_cam)
priv->staging_rxon.rx_chain |= RXON_RX_CHAIN_MIMO_FORCE_MSK; priv->staging_rxon.rx_chain |= RXON_RX_CHAIN_MIMO_FORCE_MSK;
else else
priv->staging_rxon.rx_chain &= ~RXON_RX_CHAIN_MIMO_FORCE_MSK; priv->staging_rxon.rx_chain &= ~RXON_RX_CHAIN_MIMO_FORCE_MSK;
IWL_DEBUG_ASSOC("rx chain %X\n", priv->staging_rxon.rx_chain); IWL_DEBUG_ASSOC("rx_chain=0x%Xi active=%d idle=%d\n",
priv->staging_rxon.rx_chain,
active_rx_cnt, idle_rx_cnt);
WARN_ON(active_rx_cnt == 0 || idle_rx_cnt == 0 ||
active_rx_cnt < idle_rx_cnt);
} }
EXPORT_SYMBOL(iwl_set_rxon_chain); EXPORT_SYMBOL(iwl_set_rxon_chain);
......
...@@ -412,7 +412,6 @@ struct iwl_ht_info { ...@@ -412,7 +412,6 @@ struct iwl_ht_info {
/* self configuration data */ /* self configuration data */
u8 is_ht; u8 is_ht;
u8 supported_chan_width; u8 supported_chan_width;
u16 tx_mimo_ps_mode;
u8 is_green_field; u8 is_green_field;
u8 sgf; /* HT_SHORT_GI_* short guard interval */ u8 sgf; /* HT_SHORT_GI_* short guard interval */
u8 max_amsdu_size; u8 max_amsdu_size;
......
...@@ -1173,7 +1173,10 @@ void iwl_rx_reply_rx(struct iwl_priv *priv, ...@@ -1173,7 +1173,10 @@ void iwl_rx_reply_rx(struct iwl_priv *priv,
rx_status.antenna = 0; rx_status.antenna = 0;
rx_status.flag = 0; rx_status.flag = 0;
rx_status.flag |= RX_FLAG_TSFT;
/* TSF isn't reliable. In order to allow smooth user experience,
* this W/A doesn't propagate it to the mac80211 */
/*rx_status.flag |= RX_FLAG_TSFT;*/
if ((unlikely(rx_start->cfg_phy_cnt > 20))) { if ((unlikely(rx_start->cfg_phy_cnt > 20))) {
IWL_DEBUG_DROP("dsp size out of range [0,20]: %d/n", IWL_DEBUG_DROP("dsp size out of range [0,20]: %d/n",
......
...@@ -421,7 +421,7 @@ static int iwl_get_channels_for_scan(struct iwl_priv *priv, ...@@ -421,7 +421,7 @@ static int iwl_get_channels_for_scan(struct iwl_priv *priv,
else else
scan_ch->type = SCAN_CHANNEL_TYPE_ACTIVE; scan_ch->type = SCAN_CHANNEL_TYPE_ACTIVE;
if ((scan_ch->type & SCAN_CHANNEL_TYPE_ACTIVE) && n_probes) if (n_probes)
scan_ch->type |= IWL_SCAN_PROBE_MASK(n_probes); scan_ch->type |= IWL_SCAN_PROBE_MASK(n_probes);
scan_ch->active_dwell = cpu_to_le16(active_dwell); scan_ch->active_dwell = cpu_to_le16(active_dwell);
......
...@@ -402,12 +402,11 @@ static int iwl_hw_tx_queue_init(struct iwl_priv *priv, ...@@ -402,12 +402,11 @@ static int iwl_hw_tx_queue_init(struct iwl_priv *priv,
/** /**
* iwl_tx_queue_init - Allocate and initialize one tx/cmd queue * iwl_tx_queue_init - Allocate and initialize one tx/cmd queue
*/ */
static int iwl_tx_queue_init(struct iwl_priv *priv, static int iwl_tx_queue_init(struct iwl_priv *priv, struct iwl_tx_queue *txq,
struct iwl_tx_queue *txq,
int slots_num, u32 txq_id) int slots_num, u32 txq_id)
{ {
int i, len; int i, len;
int rc = 0; int ret;
/* /*
* Alloc buffer array for commands (Tx or other types of commands). * Alloc buffer array for commands (Tx or other types of commands).
...@@ -428,17 +427,14 @@ static int iwl_tx_queue_init(struct iwl_priv *priv, ...@@ -428,17 +427,14 @@ static int iwl_tx_queue_init(struct iwl_priv *priv,
txq->cmd[i] = kmalloc(len, GFP_KERNEL); txq->cmd[i] = kmalloc(len, GFP_KERNEL);
if (!txq->cmd[i]) if (!txq->cmd[i])
return -ENOMEM; goto err;
} }
/* Alloc driver data array and TFD circular buffer */ /* Alloc driver data array and TFD circular buffer */
rc = iwl_tx_queue_alloc(priv, txq, txq_id); ret = iwl_tx_queue_alloc(priv, txq, txq_id);
if (rc) { if (ret)
for (i = 0; i < slots_num; i++) goto err;
kfree(txq->cmd[i]);
return -ENOMEM;
}
txq->need_update = 0; txq->need_update = 0;
/* TFD_QUEUE_SIZE_MAX must be power-of-two size, otherwise /* TFD_QUEUE_SIZE_MAX must be power-of-two size, otherwise
...@@ -452,6 +448,17 @@ static int iwl_tx_queue_init(struct iwl_priv *priv, ...@@ -452,6 +448,17 @@ static int iwl_tx_queue_init(struct iwl_priv *priv,
iwl_hw_tx_queue_init(priv, txq); iwl_hw_tx_queue_init(priv, txq);
return 0; return 0;
err:
for (i = 0; i < slots_num; i++) {
kfree(txq->cmd[i]);
txq->cmd[i] = NULL;
}
if (txq_id == IWL_CMD_QUEUE_NUM) {
kfree(txq->cmd[slots_num]);
txq->cmd[slots_num] = NULL;
}
return -ENOMEM;
} }
/** /**
* iwl_hw_txq_ctx_free - Free TXQ Context * iwl_hw_txq_ctx_free - Free TXQ Context
......
...@@ -96,8 +96,8 @@ struct bcbearer { ...@@ -96,8 +96,8 @@ struct bcbearer {
struct media media; struct media media;
struct bcbearer_pair bpairs[MAX_BEARERS]; struct bcbearer_pair bpairs[MAX_BEARERS];
struct bcbearer_pair bpairs_temp[TIPC_MAX_LINK_PRI + 1]; struct bcbearer_pair bpairs_temp[TIPC_MAX_LINK_PRI + 1];
struct node_map remains; struct tipc_node_map remains;
struct node_map remains_new; struct tipc_node_map remains_new;
}; };
/** /**
...@@ -110,7 +110,7 @@ struct bcbearer { ...@@ -110,7 +110,7 @@ struct bcbearer {
struct bclink { struct bclink {
struct link link; struct link link;
struct node node; struct tipc_node node;
}; };
...@@ -149,7 +149,7 @@ static void bcbuf_decr_acks(struct sk_buff *buf) ...@@ -149,7 +149,7 @@ static void bcbuf_decr_acks(struct sk_buff *buf)
* Called with 'node' locked, bc_lock unlocked * Called with 'node' locked, bc_lock unlocked
*/ */
static void bclink_set_gap(struct node *n_ptr) static void bclink_set_gap(struct tipc_node *n_ptr)
{ {
struct sk_buff *buf = n_ptr->bclink.deferred_head; struct sk_buff *buf = n_ptr->bclink.deferred_head;
...@@ -202,7 +202,7 @@ static void bclink_retransmit_pkt(u32 after, u32 to) ...@@ -202,7 +202,7 @@ static void bclink_retransmit_pkt(u32 after, u32 to)
* Node is locked, bc_lock unlocked. * Node is locked, bc_lock unlocked.
*/ */
void tipc_bclink_acknowledge(struct node *n_ptr, u32 acked) void tipc_bclink_acknowledge(struct tipc_node *n_ptr, u32 acked)
{ {
struct sk_buff *crs; struct sk_buff *crs;
struct sk_buff *next; struct sk_buff *next;
...@@ -250,7 +250,7 @@ void tipc_bclink_acknowledge(struct node *n_ptr, u32 acked) ...@@ -250,7 +250,7 @@ void tipc_bclink_acknowledge(struct node *n_ptr, u32 acked)
* tipc_net_lock and node lock set * tipc_net_lock and node lock set
*/ */
static void bclink_send_ack(struct node *n_ptr) static void bclink_send_ack(struct tipc_node *n_ptr)
{ {
struct link *l_ptr = n_ptr->active_links[n_ptr->addr & 1]; struct link *l_ptr = n_ptr->active_links[n_ptr->addr & 1];
...@@ -264,7 +264,7 @@ static void bclink_send_ack(struct node *n_ptr) ...@@ -264,7 +264,7 @@ static void bclink_send_ack(struct node *n_ptr)
* tipc_net_lock and node lock set * tipc_net_lock and node lock set
*/ */
static void bclink_send_nack(struct node *n_ptr) static void bclink_send_nack(struct tipc_node *n_ptr)
{ {
struct sk_buff *buf; struct sk_buff *buf;
struct tipc_msg *msg; struct tipc_msg *msg;
...@@ -308,7 +308,7 @@ static void bclink_send_nack(struct node *n_ptr) ...@@ -308,7 +308,7 @@ static void bclink_send_nack(struct node *n_ptr)
* tipc_net_lock and node lock set * tipc_net_lock and node lock set
*/ */
void tipc_bclink_check_gap(struct node *n_ptr, u32 last_sent) void tipc_bclink_check_gap(struct tipc_node *n_ptr, u32 last_sent)
{ {
if (!n_ptr->bclink.supported || if (!n_ptr->bclink.supported ||
less_eq(last_sent, mod(n_ptr->bclink.last_in))) less_eq(last_sent, mod(n_ptr->bclink.last_in)))
...@@ -328,7 +328,7 @@ void tipc_bclink_check_gap(struct node *n_ptr, u32 last_sent) ...@@ -328,7 +328,7 @@ void tipc_bclink_check_gap(struct node *n_ptr, u32 last_sent)
static void tipc_bclink_peek_nack(u32 dest, u32 sender_tag, u32 gap_after, u32 gap_to) static void tipc_bclink_peek_nack(u32 dest, u32 sender_tag, u32 gap_after, u32 gap_to)
{ {
struct node *n_ptr = tipc_node_find(dest); struct tipc_node *n_ptr = tipc_node_find(dest);
u32 my_after, my_to; u32 my_after, my_to;
if (unlikely(!n_ptr || !tipc_node_is_up(n_ptr))) if (unlikely(!n_ptr || !tipc_node_is_up(n_ptr)))
...@@ -418,7 +418,7 @@ void tipc_bclink_recv_pkt(struct sk_buff *buf) ...@@ -418,7 +418,7 @@ void tipc_bclink_recv_pkt(struct sk_buff *buf)
static int rx_count = 0; static int rx_count = 0;
#endif #endif
struct tipc_msg *msg = buf_msg(buf); struct tipc_msg *msg = buf_msg(buf);
struct node* node = tipc_node_find(msg_prevnode(msg)); struct tipc_node* node = tipc_node_find(msg_prevnode(msg));
u32 next_in; u32 next_in;
u32 seqno; u32 seqno;
struct sk_buff *deferred; struct sk_buff *deferred;
...@@ -538,7 +538,7 @@ u32 tipc_bclink_get_last_sent(void) ...@@ -538,7 +538,7 @@ u32 tipc_bclink_get_last_sent(void)
return last_sent; return last_sent;
} }
u32 tipc_bclink_acks_missing(struct node *n_ptr) u32 tipc_bclink_acks_missing(struct tipc_node *n_ptr)
{ {
return (n_ptr->bclink.supported && return (n_ptr->bclink.supported &&
(tipc_bclink_get_last_sent() != n_ptr->bclink.acked)); (tipc_bclink_get_last_sent() != n_ptr->bclink.acked));
......
...@@ -41,12 +41,12 @@ ...@@ -41,12 +41,12 @@
#define WSIZE 32 #define WSIZE 32
/** /**
* struct node_map - set of node identifiers * struct tipc_node_map - set of node identifiers
* @count: # of nodes in set * @count: # of nodes in set
* @map: bitmap of node identifiers that are in the set * @map: bitmap of node identifiers that are in the set
*/ */
struct node_map { struct tipc_node_map {
u32 count; u32 count;
u32 map[MAX_NODES / WSIZE]; u32 map[MAX_NODES / WSIZE];
}; };
...@@ -68,7 +68,7 @@ struct port_list { ...@@ -68,7 +68,7 @@ struct port_list {
}; };
struct node; struct tipc_node;
extern char tipc_bclink_name[]; extern char tipc_bclink_name[];
...@@ -77,7 +77,7 @@ extern char tipc_bclink_name[]; ...@@ -77,7 +77,7 @@ extern char tipc_bclink_name[];
* nmap_add - add a node to a node map * nmap_add - add a node to a node map
*/ */
static inline void tipc_nmap_add(struct node_map *nm_ptr, u32 node) static inline void tipc_nmap_add(struct tipc_node_map *nm_ptr, u32 node)
{ {
int n = tipc_node(node); int n = tipc_node(node);
int w = n / WSIZE; int w = n / WSIZE;
...@@ -93,7 +93,7 @@ static inline void tipc_nmap_add(struct node_map *nm_ptr, u32 node) ...@@ -93,7 +93,7 @@ static inline void tipc_nmap_add(struct node_map *nm_ptr, u32 node)
* nmap_remove - remove a node from a node map * nmap_remove - remove a node from a node map
*/ */
static inline void tipc_nmap_remove(struct node_map *nm_ptr, u32 node) static inline void tipc_nmap_remove(struct tipc_node_map *nm_ptr, u32 node)
{ {
int n = tipc_node(node); int n = tipc_node(node);
int w = n / WSIZE; int w = n / WSIZE;
...@@ -109,7 +109,7 @@ static inline void tipc_nmap_remove(struct node_map *nm_ptr, u32 node) ...@@ -109,7 +109,7 @@ static inline void tipc_nmap_remove(struct node_map *nm_ptr, u32 node)
* nmap_equal - test for equality of node maps * nmap_equal - test for equality of node maps
*/ */
static inline int tipc_nmap_equal(struct node_map *nm_a, struct node_map *nm_b) static inline int tipc_nmap_equal(struct tipc_node_map *nm_a, struct tipc_node_map *nm_b)
{ {
return !memcmp(nm_a, nm_b, sizeof(*nm_a)); return !memcmp(nm_a, nm_b, sizeof(*nm_a));
} }
...@@ -121,8 +121,8 @@ static inline int tipc_nmap_equal(struct node_map *nm_a, struct node_map *nm_b) ...@@ -121,8 +121,8 @@ static inline int tipc_nmap_equal(struct node_map *nm_a, struct node_map *nm_b)
* @nm_diff: output node map A-B (i.e. nodes of A that are not in B) * @nm_diff: output node map A-B (i.e. nodes of A that are not in B)
*/ */
static inline void tipc_nmap_diff(struct node_map *nm_a, struct node_map *nm_b, static inline void tipc_nmap_diff(struct tipc_node_map *nm_a, struct tipc_node_map *nm_b,
struct node_map *nm_diff) struct tipc_node_map *nm_diff)
{ {
int stop = sizeof(nm_a->map) / sizeof(u32); int stop = sizeof(nm_a->map) / sizeof(u32);
int w; int w;
...@@ -195,12 +195,12 @@ static inline void tipc_port_list_free(struct port_list *pl_ptr) ...@@ -195,12 +195,12 @@ static inline void tipc_port_list_free(struct port_list *pl_ptr)
int tipc_bclink_init(void); int tipc_bclink_init(void);
void tipc_bclink_stop(void); void tipc_bclink_stop(void);
void tipc_bclink_acknowledge(struct node *n_ptr, u32 acked); void tipc_bclink_acknowledge(struct tipc_node *n_ptr, u32 acked);
int tipc_bclink_send_msg(struct sk_buff *buf); int tipc_bclink_send_msg(struct sk_buff *buf);
void tipc_bclink_recv_pkt(struct sk_buff *buf); void tipc_bclink_recv_pkt(struct sk_buff *buf);
u32 tipc_bclink_get_last_sent(void); u32 tipc_bclink_get_last_sent(void);
u32 tipc_bclink_acks_missing(struct node *n_ptr); u32 tipc_bclink_acks_missing(struct tipc_node *n_ptr);
void tipc_bclink_check_gap(struct node *n_ptr, u32 seqno); void tipc_bclink_check_gap(struct tipc_node *n_ptr, u32 seqno);
int tipc_bclink_stats(char *stats_buf, const u32 buf_size); int tipc_bclink_stats(char *stats_buf, const u32 buf_size);
int tipc_bclink_reset_stats(void); int tipc_bclink_reset_stats(void);
int tipc_bclink_set_queue_limits(u32 limit); int tipc_bclink_set_queue_limits(u32 limit);
......
...@@ -599,7 +599,7 @@ int tipc_block_bearer(const char *name) ...@@ -599,7 +599,7 @@ int tipc_block_bearer(const char *name)
spin_lock_bh(&b_ptr->publ.lock); spin_lock_bh(&b_ptr->publ.lock);
b_ptr->publ.blocked = 1; b_ptr->publ.blocked = 1;
list_for_each_entry_safe(l_ptr, temp_l_ptr, &b_ptr->links, link_list) { list_for_each_entry_safe(l_ptr, temp_l_ptr, &b_ptr->links, link_list) {
struct node *n_ptr = l_ptr->owner; struct tipc_node *n_ptr = l_ptr->owner;
spin_lock_bh(&n_ptr->lock); spin_lock_bh(&n_ptr->lock);
tipc_link_reset(l_ptr); tipc_link_reset(l_ptr);
......
...@@ -104,7 +104,7 @@ struct bearer { ...@@ -104,7 +104,7 @@ struct bearer {
u32 continue_count; u32 continue_count;
int active; int active;
char net_plane; char net_plane;
struct node_map nodes; struct tipc_node_map nodes;
}; };
struct bearer_name { struct bearer_name {
......
...@@ -48,8 +48,8 @@ static void tipc_cltr_multicast(struct cluster *c_ptr, struct sk_buff *buf, ...@@ -48,8 +48,8 @@ static void tipc_cltr_multicast(struct cluster *c_ptr, struct sk_buff *buf,
u32 lower, u32 upper); u32 lower, u32 upper);
static struct sk_buff *tipc_cltr_prepare_routing_msg(u32 data_size, u32 dest); static struct sk_buff *tipc_cltr_prepare_routing_msg(u32 data_size, u32 dest);
struct node **tipc_local_nodes = NULL; struct tipc_node **tipc_local_nodes = NULL;
struct node_map tipc_cltr_bcast_nodes = {0,{0,}}; struct tipc_node_map tipc_cltr_bcast_nodes = {0,{0,}};
u32 tipc_highest_allowed_slave = 0; u32 tipc_highest_allowed_slave = 0;
struct cluster *tipc_cltr_create(u32 addr) struct cluster *tipc_cltr_create(u32 addr)
...@@ -115,7 +115,7 @@ void tipc_cltr_delete(struct cluster *c_ptr) ...@@ -115,7 +115,7 @@ void tipc_cltr_delete(struct cluster *c_ptr)
u32 tipc_cltr_next_node(struct cluster *c_ptr, u32 addr) u32 tipc_cltr_next_node(struct cluster *c_ptr, u32 addr)
{ {
struct node *n_ptr; struct tipc_node *n_ptr;
u32 n_num = tipc_node(addr) + 1; u32 n_num = tipc_node(addr) + 1;
if (!c_ptr) if (!c_ptr)
...@@ -133,7 +133,7 @@ u32 tipc_cltr_next_node(struct cluster *c_ptr, u32 addr) ...@@ -133,7 +133,7 @@ u32 tipc_cltr_next_node(struct cluster *c_ptr, u32 addr)
return 0; return 0;
} }
void tipc_cltr_attach_node(struct cluster *c_ptr, struct node *n_ptr) void tipc_cltr_attach_node(struct cluster *c_ptr, struct tipc_node *n_ptr)
{ {
u32 n_num = tipc_node(n_ptr->addr); u32 n_num = tipc_node(n_ptr->addr);
u32 max_n_num = tipc_max_nodes; u32 max_n_num = tipc_max_nodes;
...@@ -196,7 +196,7 @@ u32 tipc_cltr_select_router(struct cluster *c_ptr, u32 ref) ...@@ -196,7 +196,7 @@ u32 tipc_cltr_select_router(struct cluster *c_ptr, u32 ref)
* Uses deterministic and fair algorithm. * Uses deterministic and fair algorithm.
*/ */
struct node *tipc_cltr_select_node(struct cluster *c_ptr, u32 selector) struct tipc_node *tipc_cltr_select_node(struct cluster *c_ptr, u32 selector)
{ {
u32 n_num; u32 n_num;
u32 mask = tipc_max_nodes; u32 mask = tipc_max_nodes;
...@@ -379,7 +379,7 @@ void tipc_cltr_recv_routing_table(struct sk_buff *buf) ...@@ -379,7 +379,7 @@ void tipc_cltr_recv_routing_table(struct sk_buff *buf)
{ {
struct tipc_msg *msg = buf_msg(buf); struct tipc_msg *msg = buf_msg(buf);
struct cluster *c_ptr; struct cluster *c_ptr;
struct node *n_ptr; struct tipc_node *n_ptr;
unchar *node_table; unchar *node_table;
u32 table_size; u32 table_size;
u32 router; u32 router;
...@@ -499,7 +499,7 @@ static void tipc_cltr_multicast(struct cluster *c_ptr, struct sk_buff *buf, ...@@ -499,7 +499,7 @@ static void tipc_cltr_multicast(struct cluster *c_ptr, struct sk_buff *buf,
u32 lower, u32 upper) u32 lower, u32 upper)
{ {
struct sk_buff *buf_copy; struct sk_buff *buf_copy;
struct node *n_ptr; struct tipc_node *n_ptr;
u32 n_num; u32 n_num;
u32 tstop; u32 tstop;
...@@ -534,7 +534,7 @@ void tipc_cltr_broadcast(struct sk_buff *buf) ...@@ -534,7 +534,7 @@ void tipc_cltr_broadcast(struct sk_buff *buf)
{ {
struct sk_buff *buf_copy; struct sk_buff *buf_copy;
struct cluster *c_ptr; struct cluster *c_ptr;
struct node *n_ptr; struct tipc_node *n_ptr;
u32 n_num; u32 n_num;
u32 tstart; u32 tstart;
u32 tstop; u32 tstop;
......
...@@ -54,24 +54,24 @@ ...@@ -54,24 +54,24 @@
struct cluster { struct cluster {
u32 addr; u32 addr;
struct _zone *owner; struct _zone *owner;
struct node **nodes; struct tipc_node **nodes;
u32 highest_node; u32 highest_node;
u32 highest_slave; u32 highest_slave;
}; };
extern struct node **tipc_local_nodes; extern struct tipc_node **tipc_local_nodes;
extern u32 tipc_highest_allowed_slave; extern u32 tipc_highest_allowed_slave;
extern struct node_map tipc_cltr_bcast_nodes; extern struct tipc_node_map tipc_cltr_bcast_nodes;
void tipc_cltr_remove_as_router(struct cluster *c_ptr, u32 router); void tipc_cltr_remove_as_router(struct cluster *c_ptr, u32 router);
void tipc_cltr_send_ext_routes(struct cluster *c_ptr, u32 dest); void tipc_cltr_send_ext_routes(struct cluster *c_ptr, u32 dest);
struct node *tipc_cltr_select_node(struct cluster *c_ptr, u32 selector); struct tipc_node *tipc_cltr_select_node(struct cluster *c_ptr, u32 selector);
u32 tipc_cltr_select_router(struct cluster *c_ptr, u32 ref); u32 tipc_cltr_select_router(struct cluster *c_ptr, u32 ref);
void tipc_cltr_recv_routing_table(struct sk_buff *buf); void tipc_cltr_recv_routing_table(struct sk_buff *buf);
struct cluster *tipc_cltr_create(u32 addr); struct cluster *tipc_cltr_create(u32 addr);
void tipc_cltr_delete(struct cluster *c_ptr); void tipc_cltr_delete(struct cluster *c_ptr);
void tipc_cltr_attach_node(struct cluster *c_ptr, struct node *n_ptr); void tipc_cltr_attach_node(struct cluster *c_ptr, struct tipc_node *n_ptr);
void tipc_cltr_send_slave_routes(struct cluster *c_ptr, u32 dest); void tipc_cltr_send_slave_routes(struct cluster *c_ptr, u32 dest);
void tipc_cltr_broadcast(struct sk_buff *buf); void tipc_cltr_broadcast(struct sk_buff *buf);
int tipc_cltr_init(void); int tipc_cltr_init(void);
......
...@@ -193,7 +193,7 @@ void tipc_disc_recv_msg(struct sk_buff *buf, struct bearer *b_ptr) ...@@ -193,7 +193,7 @@ void tipc_disc_recv_msg(struct sk_buff *buf, struct bearer *b_ptr)
/* Always accept link here */ /* Always accept link here */
struct sk_buff *rbuf; struct sk_buff *rbuf;
struct tipc_media_addr *addr; struct tipc_media_addr *addr;
struct node *n_ptr = tipc_node_find(orig); struct tipc_node *n_ptr = tipc_node_find(orig);
int link_fully_up; int link_fully_up;
dbg(" in own cluster\n"); dbg(" in own cluster\n");
......
...@@ -1155,7 +1155,7 @@ int tipc_link_send_buf(struct link *l_ptr, struct sk_buff *buf) ...@@ -1155,7 +1155,7 @@ int tipc_link_send_buf(struct link *l_ptr, struct sk_buff *buf)
int tipc_link_send(struct sk_buff *buf, u32 dest, u32 selector) int tipc_link_send(struct sk_buff *buf, u32 dest, u32 selector)
{ {
struct link *l_ptr; struct link *l_ptr;
struct node *n_ptr; struct tipc_node *n_ptr;
int res = -ELINKCONG; int res = -ELINKCONG;
read_lock_bh(&tipc_net_lock); read_lock_bh(&tipc_net_lock);
...@@ -1226,7 +1226,7 @@ static int link_send_buf_fast(struct link *l_ptr, struct sk_buff *buf, ...@@ -1226,7 +1226,7 @@ static int link_send_buf_fast(struct link *l_ptr, struct sk_buff *buf,
int tipc_send_buf_fast(struct sk_buff *buf, u32 destnode) int tipc_send_buf_fast(struct sk_buff *buf, u32 destnode)
{ {
struct link *l_ptr; struct link *l_ptr;
struct node *n_ptr; struct tipc_node *n_ptr;
int res; int res;
u32 selector = msg_origport(buf_msg(buf)) & 1; u32 selector = msg_origport(buf_msg(buf)) & 1;
u32 dummy; u32 dummy;
...@@ -1270,7 +1270,7 @@ int tipc_link_send_sections_fast(struct port *sender, ...@@ -1270,7 +1270,7 @@ int tipc_link_send_sections_fast(struct port *sender,
struct tipc_msg *hdr = &sender->publ.phdr; struct tipc_msg *hdr = &sender->publ.phdr;
struct link *l_ptr; struct link *l_ptr;
struct sk_buff *buf; struct sk_buff *buf;
struct node *node; struct tipc_node *node;
int res; int res;
u32 selector = msg_origport(hdr) & 1; u32 selector = msg_origport(hdr) & 1;
...@@ -1364,7 +1364,7 @@ static int link_send_sections_long(struct port *sender, ...@@ -1364,7 +1364,7 @@ static int link_send_sections_long(struct port *sender,
u32 destaddr) u32 destaddr)
{ {
struct link *l_ptr; struct link *l_ptr;
struct node *node; struct tipc_node *node;
struct tipc_msg *hdr = &sender->publ.phdr; struct tipc_msg *hdr = &sender->publ.phdr;
u32 dsz = msg_data_sz(hdr); u32 dsz = msg_data_sz(hdr);
u32 max_pkt,fragm_sz,rest; u32 max_pkt,fragm_sz,rest;
...@@ -1636,7 +1636,7 @@ void tipc_link_push_queue(struct link *l_ptr) ...@@ -1636,7 +1636,7 @@ void tipc_link_push_queue(struct link *l_ptr)
static void link_reset_all(unsigned long addr) static void link_reset_all(unsigned long addr)
{ {
struct node *n_ptr; struct tipc_node *n_ptr;
char addr_string[16]; char addr_string[16];
u32 i; u32 i;
...@@ -1682,7 +1682,7 @@ static void link_retransmit_failure(struct link *l_ptr, struct sk_buff *buf) ...@@ -1682,7 +1682,7 @@ static void link_retransmit_failure(struct link *l_ptr, struct sk_buff *buf)
/* Handle failure on broadcast link */ /* Handle failure on broadcast link */
struct node *n_ptr; struct tipc_node *n_ptr;
char addr_string[16]; char addr_string[16];
tipc_printf(TIPC_OUTPUT, "Msg seq number: %u, ", msg_seqno(msg)); tipc_printf(TIPC_OUTPUT, "Msg seq number: %u, ", msg_seqno(msg));
...@@ -1843,7 +1843,7 @@ void tipc_recv_msg(struct sk_buff *head, struct tipc_bearer *tb_ptr) ...@@ -1843,7 +1843,7 @@ void tipc_recv_msg(struct sk_buff *head, struct tipc_bearer *tb_ptr)
read_lock_bh(&tipc_net_lock); read_lock_bh(&tipc_net_lock);
while (head) { while (head) {
struct bearer *b_ptr = (struct bearer *)tb_ptr; struct bearer *b_ptr = (struct bearer *)tb_ptr;
struct node *n_ptr; struct tipc_node *n_ptr;
struct link *l_ptr; struct link *l_ptr;
struct sk_buff *crs; struct sk_buff *crs;
struct sk_buff *buf = head; struct sk_buff *buf = head;
...@@ -2935,7 +2935,7 @@ void tipc_link_set_queue_limits(struct link *l_ptr, u32 window) ...@@ -2935,7 +2935,7 @@ void tipc_link_set_queue_limits(struct link *l_ptr, u32 window)
* Returns pointer to link (or 0 if invalid link name). * Returns pointer to link (or 0 if invalid link name).
*/ */
static struct link *link_find_link(const char *name, struct node **node) static struct link *link_find_link(const char *name, struct tipc_node **node)
{ {
struct link_name link_name_parts; struct link_name link_name_parts;
struct bearer *b_ptr; struct bearer *b_ptr;
...@@ -2965,7 +2965,7 @@ struct sk_buff *tipc_link_cmd_config(const void *req_tlv_area, int req_tlv_space ...@@ -2965,7 +2965,7 @@ struct sk_buff *tipc_link_cmd_config(const void *req_tlv_area, int req_tlv_space
struct tipc_link_config *args; struct tipc_link_config *args;
u32 new_value; u32 new_value;
struct link *l_ptr; struct link *l_ptr;
struct node *node; struct tipc_node *node;
int res; int res;
if (!TLV_CHECK(req_tlv_area, req_tlv_space, TIPC_TLV_LINK_CONFIG)) if (!TLV_CHECK(req_tlv_area, req_tlv_space, TIPC_TLV_LINK_CONFIG))
...@@ -3043,7 +3043,7 @@ struct sk_buff *tipc_link_cmd_reset_stats(const void *req_tlv_area, int req_tlv_ ...@@ -3043,7 +3043,7 @@ struct sk_buff *tipc_link_cmd_reset_stats(const void *req_tlv_area, int req_tlv_
{ {
char *link_name; char *link_name;
struct link *l_ptr; struct link *l_ptr;
struct node *node; struct tipc_node *node;
if (!TLV_CHECK(req_tlv_area, req_tlv_space, TIPC_TLV_LINK_NAME)) if (!TLV_CHECK(req_tlv_area, req_tlv_space, TIPC_TLV_LINK_NAME))
return tipc_cfg_reply_error_string(TIPC_CFG_TLV_ERROR); return tipc_cfg_reply_error_string(TIPC_CFG_TLV_ERROR);
...@@ -3091,7 +3091,7 @@ static int tipc_link_stats(const char *name, char *buf, const u32 buf_size) ...@@ -3091,7 +3091,7 @@ static int tipc_link_stats(const char *name, char *buf, const u32 buf_size)
{ {
struct print_buf pb; struct print_buf pb;
struct link *l_ptr; struct link *l_ptr;
struct node *node; struct tipc_node *node;
char *status; char *status;
u32 profile_total = 0; u32 profile_total = 0;
...@@ -3207,7 +3207,7 @@ int link_control(const char *name, u32 op, u32 val) ...@@ -3207,7 +3207,7 @@ int link_control(const char *name, u32 op, u32 val)
int res = -EINVAL; int res = -EINVAL;
struct link *l_ptr; struct link *l_ptr;
u32 bearer_id; u32 bearer_id;
struct node * node; struct tipc_node * node;
u32 a; u32 a;
a = link_name2addr(name, &bearer_id); a = link_name2addr(name, &bearer_id);
...@@ -3249,7 +3249,7 @@ int link_control(const char *name, u32 op, u32 val) ...@@ -3249,7 +3249,7 @@ int link_control(const char *name, u32 op, u32 val)
u32 tipc_link_get_max_pkt(u32 dest, u32 selector) u32 tipc_link_get_max_pkt(u32 dest, u32 selector)
{ {
struct node *n_ptr; struct tipc_node *n_ptr;
struct link *l_ptr; struct link *l_ptr;
u32 res = MAX_PKT_DEFAULT; u32 res = MAX_PKT_DEFAULT;
......
...@@ -116,7 +116,7 @@ struct link { ...@@ -116,7 +116,7 @@ struct link {
char name[TIPC_MAX_LINK_NAME]; char name[TIPC_MAX_LINK_NAME];
struct tipc_media_addr media_addr; struct tipc_media_addr media_addr;
struct timer_list timer; struct timer_list timer;
struct node *owner; struct tipc_node *owner;
struct list_head link_list; struct list_head link_list;
/* Management and link supervision data */ /* Management and link supervision data */
......
...@@ -76,7 +76,7 @@ struct publication { ...@@ -76,7 +76,7 @@ struct publication {
u32 node; u32 node;
u32 ref; u32 ref;
u32 key; u32 key;
struct node_subscr subscr; struct tipc_node_subscr subscr;
struct list_head local_list; struct list_head local_list;
struct list_head pport_list; struct list_head pport_list;
struct publication *node_list_next; struct publication *node_list_next;
......
...@@ -118,7 +118,7 @@ ...@@ -118,7 +118,7 @@
DEFINE_RWLOCK(tipc_net_lock); DEFINE_RWLOCK(tipc_net_lock);
struct network tipc_net = { NULL }; struct network tipc_net = { NULL };
struct node *tipc_net_select_remote_node(u32 addr, u32 ref) struct tipc_node *tipc_net_select_remote_node(u32 addr, u32 ref)
{ {
return tipc_zone_select_remote_node(tipc_net.zones[tipc_zone(addr)], addr, ref); return tipc_zone_select_remote_node(tipc_net.zones[tipc_zone(addr)], addr, ref);
} }
......
...@@ -55,7 +55,7 @@ extern rwlock_t tipc_net_lock; ...@@ -55,7 +55,7 @@ extern rwlock_t tipc_net_lock;
void tipc_net_remove_as_router(u32 router); void tipc_net_remove_as_router(u32 router);
void tipc_net_send_external_routes(u32 dest); void tipc_net_send_external_routes(u32 dest);
void tipc_net_route_msg(struct sk_buff *buf); void tipc_net_route_msg(struct sk_buff *buf);
struct node *tipc_net_select_remote_node(u32 addr, u32 ref); struct tipc_node *tipc_net_select_remote_node(u32 addr, u32 ref);
u32 tipc_net_select_router(u32 addr, u32 ref); u32 tipc_net_select_router(u32 addr, u32 ref);
int tipc_net_start(u32 addr); int tipc_net_start(u32 addr);
......
...@@ -46,11 +46,11 @@ ...@@ -46,11 +46,11 @@
#include "bearer.h" #include "bearer.h"
#include "name_distr.h" #include "name_distr.h"
void node_print(struct print_buf *buf, struct node *n_ptr, char *str); void node_print(struct print_buf *buf, struct tipc_node *n_ptr, char *str);
static void node_lost_contact(struct node *n_ptr); static void node_lost_contact(struct tipc_node *n_ptr);
static void node_established_contact(struct node *n_ptr); static void node_established_contact(struct tipc_node *n_ptr);
struct node *tipc_nodes = NULL; /* sorted list of nodes within cluster */ struct tipc_node *tipc_nodes = NULL; /* sorted list of nodes within cluster */
static DEFINE_SPINLOCK(node_create_lock); static DEFINE_SPINLOCK(node_create_lock);
...@@ -66,11 +66,11 @@ u32 tipc_own_tag = 0; ...@@ -66,11 +66,11 @@ u32 tipc_own_tag = 0;
* but this is a non-trivial change.) * but this is a non-trivial change.)
*/ */
struct node *tipc_node_create(u32 addr) struct tipc_node *tipc_node_create(u32 addr)
{ {
struct cluster *c_ptr; struct cluster *c_ptr;
struct node *n_ptr; struct tipc_node *n_ptr;
struct node **curr_node; struct tipc_node **curr_node;
spin_lock_bh(&node_create_lock); spin_lock_bh(&node_create_lock);
...@@ -120,7 +120,7 @@ struct node *tipc_node_create(u32 addr) ...@@ -120,7 +120,7 @@ struct node *tipc_node_create(u32 addr)
return n_ptr; return n_ptr;
} }
void tipc_node_delete(struct node *n_ptr) void tipc_node_delete(struct tipc_node *n_ptr)
{ {
if (!n_ptr) if (!n_ptr)
return; return;
...@@ -146,7 +146,7 @@ void tipc_node_delete(struct node *n_ptr) ...@@ -146,7 +146,7 @@ void tipc_node_delete(struct node *n_ptr)
* Link becomes active (alone or shared) or standby, depending on its priority. * Link becomes active (alone or shared) or standby, depending on its priority.
*/ */
void tipc_node_link_up(struct node *n_ptr, struct link *l_ptr) void tipc_node_link_up(struct tipc_node *n_ptr, struct link *l_ptr)
{ {
struct link **active = &n_ptr->active_links[0]; struct link **active = &n_ptr->active_links[0];
...@@ -180,7 +180,7 @@ void tipc_node_link_up(struct node *n_ptr, struct link *l_ptr) ...@@ -180,7 +180,7 @@ void tipc_node_link_up(struct node *n_ptr, struct link *l_ptr)
* node_select_active_links - select active link * node_select_active_links - select active link
*/ */
static void node_select_active_links(struct node *n_ptr) static void node_select_active_links(struct tipc_node *n_ptr)
{ {
struct link **active = &n_ptr->active_links[0]; struct link **active = &n_ptr->active_links[0];
u32 i; u32 i;
...@@ -208,7 +208,7 @@ static void node_select_active_links(struct node *n_ptr) ...@@ -208,7 +208,7 @@ static void node_select_active_links(struct node *n_ptr)
* tipc_node_link_down - handle loss of link * tipc_node_link_down - handle loss of link
*/ */
void tipc_node_link_down(struct node *n_ptr, struct link *l_ptr) void tipc_node_link_down(struct tipc_node *n_ptr, struct link *l_ptr)
{ {
struct link **active; struct link **active;
...@@ -235,30 +235,30 @@ void tipc_node_link_down(struct node *n_ptr, struct link *l_ptr) ...@@ -235,30 +235,30 @@ void tipc_node_link_down(struct node *n_ptr, struct link *l_ptr)
node_lost_contact(n_ptr); node_lost_contact(n_ptr);
} }
int tipc_node_has_active_links(struct node *n_ptr) int tipc_node_has_active_links(struct tipc_node *n_ptr)
{ {
return (n_ptr && return (n_ptr &&
((n_ptr->active_links[0]) || (n_ptr->active_links[1]))); ((n_ptr->active_links[0]) || (n_ptr->active_links[1])));
} }
int tipc_node_has_redundant_links(struct node *n_ptr) int tipc_node_has_redundant_links(struct tipc_node *n_ptr)
{ {
return (n_ptr->working_links > 1); return (n_ptr->working_links > 1);
} }
static int tipc_node_has_active_routes(struct node *n_ptr) static int tipc_node_has_active_routes(struct tipc_node *n_ptr)
{ {
return (n_ptr && (n_ptr->last_router >= 0)); return (n_ptr && (n_ptr->last_router >= 0));
} }
int tipc_node_is_up(struct node *n_ptr) int tipc_node_is_up(struct tipc_node *n_ptr)
{ {
return (tipc_node_has_active_links(n_ptr) || tipc_node_has_active_routes(n_ptr)); return (tipc_node_has_active_links(n_ptr) || tipc_node_has_active_routes(n_ptr));
} }
struct node *tipc_node_attach_link(struct link *l_ptr) struct tipc_node *tipc_node_attach_link(struct link *l_ptr)
{ {
struct node *n_ptr = tipc_node_find(l_ptr->addr); struct tipc_node *n_ptr = tipc_node_find(l_ptr->addr);
if (!n_ptr) if (!n_ptr)
n_ptr = tipc_node_create(l_ptr->addr); n_ptr = tipc_node_create(l_ptr->addr);
...@@ -285,7 +285,7 @@ struct node *tipc_node_attach_link(struct link *l_ptr) ...@@ -285,7 +285,7 @@ struct node *tipc_node_attach_link(struct link *l_ptr)
return NULL; return NULL;
} }
void tipc_node_detach_link(struct node *n_ptr, struct link *l_ptr) void tipc_node_detach_link(struct tipc_node *n_ptr, struct link *l_ptr)
{ {
n_ptr->links[l_ptr->b_ptr->identity] = NULL; n_ptr->links[l_ptr->b_ptr->identity] = NULL;
tipc_net.zones[tipc_zone(l_ptr->addr)]->links--; tipc_net.zones[tipc_zone(l_ptr->addr)]->links--;
...@@ -338,7 +338,7 @@ void tipc_node_detach_link(struct node *n_ptr, struct link *l_ptr) ...@@ -338,7 +338,7 @@ void tipc_node_detach_link(struct node *n_ptr, struct link *l_ptr)
* *
*/ */
static void node_established_contact(struct node *n_ptr) static void node_established_contact(struct tipc_node *n_ptr)
{ {
struct cluster *c_ptr; struct cluster *c_ptr;
...@@ -384,10 +384,10 @@ static void node_established_contact(struct node *n_ptr) ...@@ -384,10 +384,10 @@ static void node_established_contact(struct node *n_ptr)
tipc_highest_allowed_slave); tipc_highest_allowed_slave);
} }
static void node_lost_contact(struct node *n_ptr) static void node_lost_contact(struct tipc_node *n_ptr)
{ {
struct cluster *c_ptr; struct cluster *c_ptr;
struct node_subscr *ns, *tns; struct tipc_node_subscr *ns, *tns;
char addr_string[16]; char addr_string[16];
u32 i; u32 i;
...@@ -466,9 +466,9 @@ static void node_lost_contact(struct node *n_ptr) ...@@ -466,9 +466,9 @@ static void node_lost_contact(struct node *n_ptr)
* Called by when cluster local lookup has failed. * Called by when cluster local lookup has failed.
*/ */
struct node *tipc_node_select_next_hop(u32 addr, u32 selector) struct tipc_node *tipc_node_select_next_hop(u32 addr, u32 selector)
{ {
struct node *n_ptr; struct tipc_node *n_ptr;
u32 router_addr; u32 router_addr;
if (!tipc_addr_domain_valid(addr)) if (!tipc_addr_domain_valid(addr))
...@@ -513,7 +513,7 @@ struct node *tipc_node_select_next_hop(u32 addr, u32 selector) ...@@ -513,7 +513,7 @@ struct node *tipc_node_select_next_hop(u32 addr, u32 selector)
* Uses a deterministic and fair algorithm for selecting router node. * Uses a deterministic and fair algorithm for selecting router node.
*/ */
u32 tipc_node_select_router(struct node *n_ptr, u32 ref) u32 tipc_node_select_router(struct tipc_node *n_ptr, u32 ref)
{ {
u32 ulim; u32 ulim;
u32 mask; u32 mask;
...@@ -551,7 +551,7 @@ u32 tipc_node_select_router(struct node *n_ptr, u32 ref) ...@@ -551,7 +551,7 @@ u32 tipc_node_select_router(struct node *n_ptr, u32 ref)
return tipc_addr(own_zone(), own_cluster(), r); return tipc_addr(own_zone(), own_cluster(), r);
} }
void tipc_node_add_router(struct node *n_ptr, u32 router) void tipc_node_add_router(struct tipc_node *n_ptr, u32 router)
{ {
u32 r_num = tipc_node(router); u32 r_num = tipc_node(router);
...@@ -562,7 +562,7 @@ void tipc_node_add_router(struct node *n_ptr, u32 router) ...@@ -562,7 +562,7 @@ void tipc_node_add_router(struct node *n_ptr, u32 router)
!n_ptr->routers[n_ptr->last_router]); !n_ptr->routers[n_ptr->last_router]);
} }
void tipc_node_remove_router(struct node *n_ptr, u32 router) void tipc_node_remove_router(struct tipc_node *n_ptr, u32 router)
{ {
u32 r_num = tipc_node(router); u32 r_num = tipc_node(router);
...@@ -580,7 +580,7 @@ void tipc_node_remove_router(struct node *n_ptr, u32 router) ...@@ -580,7 +580,7 @@ void tipc_node_remove_router(struct node *n_ptr, u32 router)
} }
#if 0 #if 0
void node_print(struct print_buf *buf, struct node *n_ptr, char *str) void node_print(struct print_buf *buf, struct tipc_node *n_ptr, char *str)
{ {
u32 i; u32 i;
...@@ -597,7 +597,7 @@ void node_print(struct print_buf *buf, struct node *n_ptr, char *str) ...@@ -597,7 +597,7 @@ void node_print(struct print_buf *buf, struct node *n_ptr, char *str)
u32 tipc_available_nodes(const u32 domain) u32 tipc_available_nodes(const u32 domain)
{ {
struct node *n_ptr; struct tipc_node *n_ptr;
u32 cnt = 0; u32 cnt = 0;
read_lock_bh(&tipc_net_lock); read_lock_bh(&tipc_net_lock);
...@@ -615,7 +615,7 @@ struct sk_buff *tipc_node_get_nodes(const void *req_tlv_area, int req_tlv_space) ...@@ -615,7 +615,7 @@ struct sk_buff *tipc_node_get_nodes(const void *req_tlv_area, int req_tlv_space)
{ {
u32 domain; u32 domain;
struct sk_buff *buf; struct sk_buff *buf;
struct node *n_ptr; struct tipc_node *n_ptr;
struct tipc_node_info node_info; struct tipc_node_info node_info;
u32 payload_size; u32 payload_size;
...@@ -667,7 +667,7 @@ struct sk_buff *tipc_node_get_links(const void *req_tlv_area, int req_tlv_space) ...@@ -667,7 +667,7 @@ struct sk_buff *tipc_node_get_links(const void *req_tlv_area, int req_tlv_space)
{ {
u32 domain; u32 domain;
struct sk_buff *buf; struct sk_buff *buf;
struct node *n_ptr; struct tipc_node *n_ptr;
struct tipc_link_info link_info; struct tipc_link_info link_info;
u32 payload_size; u32 payload_size;
......
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
#include "bearer.h" #include "bearer.h"
/** /**
* struct node - TIPC node structure * struct tipc_node - TIPC node structure
* @addr: network address of node * @addr: network address of node
* @lock: spinlock governing access to structure * @lock: spinlock governing access to structure
* @owner: pointer to cluster that node belongs to * @owner: pointer to cluster that node belongs to
...@@ -68,11 +68,11 @@ ...@@ -68,11 +68,11 @@
* @defragm: list of partially reassembled b'cast message fragments from node * @defragm: list of partially reassembled b'cast message fragments from node
*/ */
struct node { struct tipc_node {
u32 addr; u32 addr;
spinlock_t lock; spinlock_t lock;
struct cluster *owner; struct cluster *owner;
struct node *next; struct tipc_node *next;
struct list_head nsub; struct list_head nsub;
struct link *active_links[2]; struct link *active_links[2];
struct link *links[MAX_BEARERS]; struct link *links[MAX_BEARERS];
...@@ -94,26 +94,26 @@ struct node { ...@@ -94,26 +94,26 @@ struct node {
} bclink; } bclink;
}; };
extern struct node *tipc_nodes; extern struct tipc_node *tipc_nodes;
extern u32 tipc_own_tag; extern u32 tipc_own_tag;
struct node *tipc_node_create(u32 addr); struct tipc_node *tipc_node_create(u32 addr);
void tipc_node_delete(struct node *n_ptr); void tipc_node_delete(struct tipc_node *n_ptr);
struct node *tipc_node_attach_link(struct link *l_ptr); struct tipc_node *tipc_node_attach_link(struct link *l_ptr);
void tipc_node_detach_link(struct node *n_ptr, struct link *l_ptr); void tipc_node_detach_link(struct tipc_node *n_ptr, struct link *l_ptr);
void tipc_node_link_down(struct node *n_ptr, struct link *l_ptr); void tipc_node_link_down(struct tipc_node *n_ptr, struct link *l_ptr);
void tipc_node_link_up(struct node *n_ptr, struct link *l_ptr); void tipc_node_link_up(struct tipc_node *n_ptr, struct link *l_ptr);
int tipc_node_has_active_links(struct node *n_ptr); int tipc_node_has_active_links(struct tipc_node *n_ptr);
int tipc_node_has_redundant_links(struct node *n_ptr); int tipc_node_has_redundant_links(struct tipc_node *n_ptr);
u32 tipc_node_select_router(struct node *n_ptr, u32 ref); u32 tipc_node_select_router(struct tipc_node *n_ptr, u32 ref);
struct node *tipc_node_select_next_hop(u32 addr, u32 selector); struct tipc_node *tipc_node_select_next_hop(u32 addr, u32 selector);
int tipc_node_is_up(struct node *n_ptr); int tipc_node_is_up(struct tipc_node *n_ptr);
void tipc_node_add_router(struct node *n_ptr, u32 router); void tipc_node_add_router(struct tipc_node *n_ptr, u32 router);
void tipc_node_remove_router(struct node *n_ptr, u32 router); void tipc_node_remove_router(struct tipc_node *n_ptr, u32 router);
struct sk_buff *tipc_node_get_links(const void *req_tlv_area, int req_tlv_space); struct sk_buff *tipc_node_get_links(const void *req_tlv_area, int req_tlv_space);
struct sk_buff *tipc_node_get_nodes(const void *req_tlv_area, int req_tlv_space); struct sk_buff *tipc_node_get_nodes(const void *req_tlv_area, int req_tlv_space);
static inline struct node *tipc_node_find(u32 addr) static inline struct tipc_node *tipc_node_find(u32 addr)
{ {
if (likely(in_own_cluster(addr))) if (likely(in_own_cluster(addr)))
return tipc_local_nodes[tipc_node(addr)]; return tipc_local_nodes[tipc_node(addr)];
...@@ -126,19 +126,19 @@ static inline struct node *tipc_node_find(u32 addr) ...@@ -126,19 +126,19 @@ static inline struct node *tipc_node_find(u32 addr)
return NULL; return NULL;
} }
static inline struct node *tipc_node_select(u32 addr, u32 selector) static inline struct tipc_node *tipc_node_select(u32 addr, u32 selector)
{ {
if (likely(in_own_cluster(addr))) if (likely(in_own_cluster(addr)))
return tipc_local_nodes[tipc_node(addr)]; return tipc_local_nodes[tipc_node(addr)];
return tipc_node_select_next_hop(addr, selector); return tipc_node_select_next_hop(addr, selector);
} }
static inline void tipc_node_lock(struct node *n_ptr) static inline void tipc_node_lock(struct tipc_node *n_ptr)
{ {
spin_lock_bh(&n_ptr->lock); spin_lock_bh(&n_ptr->lock);
} }
static inline void tipc_node_unlock(struct node *n_ptr) static inline void tipc_node_unlock(struct tipc_node *n_ptr)
{ {
spin_unlock_bh(&n_ptr->lock); spin_unlock_bh(&n_ptr->lock);
} }
......
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
* tipc_nodesub_subscribe - create "node down" subscription for specified node * tipc_nodesub_subscribe - create "node down" subscription for specified node
*/ */
void tipc_nodesub_subscribe(struct node_subscr *node_sub, u32 addr, void tipc_nodesub_subscribe(struct tipc_node_subscr *node_sub, u32 addr,
void *usr_handle, net_ev_handler handle_down) void *usr_handle, net_ev_handler handle_down)
{ {
if (addr == tipc_own_addr) { if (addr == tipc_own_addr) {
...@@ -69,7 +69,7 @@ void tipc_nodesub_subscribe(struct node_subscr *node_sub, u32 addr, ...@@ -69,7 +69,7 @@ void tipc_nodesub_subscribe(struct node_subscr *node_sub, u32 addr,
* tipc_nodesub_unsubscribe - cancel "node down" subscription (if any) * tipc_nodesub_unsubscribe - cancel "node down" subscription (if any)
*/ */
void tipc_nodesub_unsubscribe(struct node_subscr *node_sub) void tipc_nodesub_unsubscribe(struct tipc_node_subscr *node_sub)
{ {
if (!node_sub->node) if (!node_sub->node)
return; return;
......
...@@ -42,22 +42,22 @@ ...@@ -42,22 +42,22 @@
typedef void (*net_ev_handler) (void *usr_handle); typedef void (*net_ev_handler) (void *usr_handle);
/** /**
* struct node_subscr - "node down" subscription entry * struct tipc_node_subscr - "node down" subscription entry
* @node: ptr to node structure of interest (or NULL, if none) * @node: ptr to node structure of interest (or NULL, if none)
* @handle_node_down: routine to invoke when node fails * @handle_node_down: routine to invoke when node fails
* @usr_handle: argument to pass to routine when node fails * @usr_handle: argument to pass to routine when node fails
* @nodesub_list: adjacent entries in list of subscriptions for the node * @nodesub_list: adjacent entries in list of subscriptions for the node
*/ */
struct node_subscr { struct tipc_node_subscr {
struct node *node; struct tipc_node *node;
net_ev_handler handle_node_down; net_ev_handler handle_node_down;
void *usr_handle; void *usr_handle;
struct list_head nodesub_list; struct list_head nodesub_list;
}; };
void tipc_nodesub_subscribe(struct node_subscr *node_sub, u32 addr, void tipc_nodesub_subscribe(struct tipc_node_subscr *node_sub, u32 addr,
void *usr_handle, net_ev_handler handle_down); void *usr_handle, net_ev_handler handle_down);
void tipc_nodesub_unsubscribe(struct node_subscr *node_sub); void tipc_nodesub_unsubscribe(struct tipc_node_subscr *node_sub);
#endif #endif
...@@ -105,7 +105,7 @@ struct port { ...@@ -105,7 +105,7 @@ struct port {
u32 probing_interval; u32 probing_interval;
u32 last_in_seqno; u32 last_in_seqno;
struct timer_list timer; struct timer_list timer;
struct node_subscr subscription; struct tipc_node_subscr subscription;
}; };
extern spinlock_t tipc_port_list_lock; extern spinlock_t tipc_port_list_lock;
......
...@@ -111,10 +111,10 @@ void tipc_zone_send_external_routes(struct _zone *z_ptr, u32 dest) ...@@ -111,10 +111,10 @@ void tipc_zone_send_external_routes(struct _zone *z_ptr, u32 dest)
} }
} }
struct node *tipc_zone_select_remote_node(struct _zone *z_ptr, u32 addr, u32 ref) struct tipc_node *tipc_zone_select_remote_node(struct _zone *z_ptr, u32 addr, u32 ref)
{ {
struct cluster *c_ptr; struct cluster *c_ptr;
struct node *n_ptr; struct tipc_node *n_ptr;
u32 c_num; u32 c_num;
if (!z_ptr) if (!z_ptr)
......
...@@ -54,7 +54,7 @@ struct _zone { ...@@ -54,7 +54,7 @@ struct _zone {
u32 links; u32 links;
}; };
struct node *tipc_zone_select_remote_node(struct _zone *z_ptr, u32 addr, u32 ref); struct tipc_node *tipc_zone_select_remote_node(struct _zone *z_ptr, u32 addr, u32 ref);
u32 tipc_zone_select_router(struct _zone *z_ptr, u32 addr, u32 ref); u32 tipc_zone_select_router(struct _zone *z_ptr, u32 addr, u32 ref);
void tipc_zone_remove_as_router(struct _zone *z_ptr, u32 router); void tipc_zone_remove_as_router(struct _zone *z_ptr, u32 router);
void tipc_zone_send_external_routes(struct _zone *z_ptr, u32 dest); void tipc_zone_send_external_routes(struct _zone *z_ptr, u32 dest);
......
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