* [PATCH net-next] vxge: make function table const
From: Stephen Hemminger @ 2011-09-16 21:10 UTC (permalink / raw)
To: Jon Mason, David Miller; +Cc: netdev
All tables of function pointers should be const.
The pre-existing code has lots of needless indirection...
Inspired by similar change in PAX.
Compile tested only.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
---
drivers/net/ethernet/neterion/vxge/vxge-config.c | 11 +++++------
drivers/net/ethernet/neterion/vxge/vxge-config.h | 4 ++--
drivers/net/ethernet/neterion/vxge/vxge-main.c | 10 +++++++---
drivers/net/ethernet/neterion/vxge/vxge-traffic.c | 12 ++++++------
4 files changed, 20 insertions(+), 17 deletions(-)
--- a/drivers/net/ethernet/neterion/vxge/vxge-config.c 2011-09-16 13:12:56.529369674 -0700
+++ b/drivers/net/ethernet/neterion/vxge/vxge-config.c 2011-09-16 13:21:30.925393238 -0700
@@ -1342,9 +1342,7 @@ vxge_hw_device_initialize(
hldev->bar0 = attr->bar0;
hldev->pdev = attr->pdev;
- hldev->uld_callbacks.link_up = attr->uld_callbacks.link_up;
- hldev->uld_callbacks.link_down = attr->uld_callbacks.link_down;
- hldev->uld_callbacks.crit_err = attr->uld_callbacks.crit_err;
+ hldev->uld_callbacks = attr->uld_callbacks;
__vxge_hw_device_pci_e_init(hldev);
@@ -2633,7 +2631,7 @@ __vxge_hw_mempool_create(struct __vxge_h
u32 items_priv_size,
u32 items_initial,
u32 items_max,
- struct vxge_hw_mempool_cbs *mp_callback,
+ const struct vxge_hw_mempool_cbs *mp_callback,
void *userdata)
{
enum vxge_hw_status status = VXGE_HW_OK;
@@ -2817,7 +2815,9 @@ __vxge_hw_ring_create(struct __vxge_hw_v
struct vxge_hw_ring_config *config;
struct __vxge_hw_device *hldev;
u32 vp_id;
- struct vxge_hw_mempool_cbs ring_mp_callback;
+ static const struct vxge_hw_mempool_cbs ring_mp_callback = {
+ .item_func_alloc = __vxge_hw_ring_mempool_item_alloc,
+ };
if ((vp == NULL) || (attr == NULL)) {
status = VXGE_HW_FAIL;
@@ -2872,7 +2872,6 @@ __vxge_hw_ring_create(struct __vxge_hw_v
/* calculate actual RxD block private size */
ring->rxdblock_priv_size = ring->rxd_priv_size * ring->rxds_per_block;
- ring_mp_callback.item_func_alloc = __vxge_hw_ring_mempool_item_alloc;
ring->mempool = __vxge_hw_mempool_create(hldev,
VXGE_HW_BLOCK_SIZE,
VXGE_HW_BLOCK_SIZE,
--- a/drivers/net/ethernet/neterion/vxge/vxge-config.h 2011-09-16 13:12:56.529369674 -0700
+++ b/drivers/net/ethernet/neterion/vxge/vxge-config.h 2011-09-16 13:21:30.925393238 -0700
@@ -740,7 +740,7 @@ struct __vxge_hw_device {
struct vxge_hw_device_config config;
enum vxge_hw_device_link_state link_state;
- struct vxge_hw_uld_cbs uld_callbacks;
+ const struct vxge_hw_uld_cbs *uld_callbacks;
u32 host_type;
u32 func_id;
@@ -840,7 +840,7 @@ struct vxge_hw_device_hw_info {
struct vxge_hw_device_attr {
void __iomem *bar0;
struct pci_dev *pdev;
- struct vxge_hw_uld_cbs uld_callbacks;
+ const struct vxge_hw_uld_cbs *uld_callbacks;
};
#define VXGE_HW_DEVICE_LINK_STATE_SET(hldev, ls) (hldev->link_state = ls)
--- a/drivers/net/ethernet/neterion/vxge/vxge-main.c 2011-09-16 13:12:56.529369674 -0700
+++ b/drivers/net/ethernet/neterion/vxge/vxge-main.c 2011-09-16 13:21:30.925393238 -0700
@@ -4284,6 +4284,12 @@ static int __devinit is_sriov_initialize
return 0;
}
+static const struct vxge_hw_uld_cbs vxge_callbacks = {
+ .link_up = vxge_callback_link_up,
+ .link_down = vxge_callback_link_down,
+ .crit_err = vxge_callback_crit_err,
+};
+
/**
* vxge_probe
* @pdev : structure containing the PCI related information of the device.
@@ -4494,9 +4500,7 @@ vxge_probe(struct pci_dev *pdev, const s
}
/* Setting driver callbacks */
- attr.uld_callbacks.link_up = vxge_callback_link_up;
- attr.uld_callbacks.link_down = vxge_callback_link_down;
- attr.uld_callbacks.crit_err = vxge_callback_crit_err;
+ attr.uld_callbacks = &vxge_callbacks;
status = vxge_hw_device_initialize(&hldev, &attr, device_config);
if (status != VXGE_HW_OK) {
--- a/drivers/net/ethernet/neterion/vxge/vxge-traffic.c 2011-09-16 13:12:56.533369674 -0700
+++ b/drivers/net/ethernet/neterion/vxge/vxge-traffic.c 2011-09-16 13:21:30.925393238 -0700
@@ -532,8 +532,8 @@ __vxge_hw_device_handle_error(struct __v
}
/* notify driver */
- if (hldev->uld_callbacks.crit_err)
- hldev->uld_callbacks.crit_err(
+ if (hldev->uld_callbacks->crit_err)
+ hldev->uld_callbacks->crit_err(
(struct __vxge_hw_device *)hldev,
type, vp_id);
out:
@@ -560,8 +560,8 @@ __vxge_hw_device_handle_link_down_ind(st
hldev->link_state = VXGE_HW_LINK_DOWN;
/* notify driver */
- if (hldev->uld_callbacks.link_down)
- hldev->uld_callbacks.link_down(hldev);
+ if (hldev->uld_callbacks->link_down)
+ hldev->uld_callbacks->link_down(hldev);
exit:
return VXGE_HW_OK;
}
@@ -585,8 +585,8 @@ __vxge_hw_device_handle_link_up_ind(stru
hldev->link_state = VXGE_HW_LINK_UP;
/* notify driver */
- if (hldev->uld_callbacks.link_up)
- hldev->uld_callbacks.link_up(hldev);
+ if (hldev->uld_callbacks->link_up)
+ hldev->uld_callbacks->link_up(hldev);
exit:
return VXGE_HW_OK;
}
^ permalink raw reply
* [PATCH net-next] bna: make function tables cont
From: Stephen Hemminger @ 2011-09-16 21:09 UTC (permalink / raw)
To: Rasesh Mody, David Miller; +Cc: netdev
To prevent malicious usage, all tables of pointers must be const.
Compile tested only.
Gleaned for PAX.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
---
drivers/net/ethernet/brocade/bna/bfa_ioc.h | 2 -
drivers/net/ethernet/brocade/bna/bfa_ioc_ct.c | 36 ++++++++++----------------
drivers/net/ethernet/brocade/bna/bna.h | 4 +-
drivers/net/ethernet/brocade/bna/bna_tx_rx.c | 4 +-
drivers/net/ethernet/brocade/bna/bnad.c | 33 +++++++++++------------
5 files changed, 36 insertions(+), 43 deletions(-)
--- a/drivers/net/ethernet/brocade/bna/bfa_ioc.h 2011-09-16 13:35:52.245432520 -0700
+++ b/drivers/net/ethernet/brocade/bna/bfa_ioc.h 2011-09-16 13:35:54.593432627 -0700
@@ -199,7 +199,7 @@ struct bfa_ioc {
struct bfi_ioc_attr *attr;
struct bfa_ioc_cbfn *cbfn;
struct bfa_ioc_mbox_mod mbox_mod;
- struct bfa_ioc_hwif *ioc_hwif;
+ const struct bfa_ioc_hwif *ioc_hwif;
struct bfa_iocpf iocpf;
enum bfi_asic_gen asic_gen;
enum bfi_asic_mode asic_mode;
--- a/drivers/net/ethernet/brocade/bna/bfa_ioc_ct.c 2011-09-16 13:35:52.273432521 -0700
+++ b/drivers/net/ethernet/brocade/bna/bfa_ioc_ct.c 2011-09-16 13:40:28.501445140 -0700
@@ -49,21 +49,21 @@ static bool bfa_ioc_ct_sync_complete(str
static enum bfa_status bfa_ioc_ct_pll_init(void __iomem *rb,
enum bfi_asic_mode asic_mode);
-static struct bfa_ioc_hwif nw_hwif_ct;
-
-static void
-bfa_ioc_set_ctx_hwif(struct bfa_ioc *ioc, struct bfa_ioc_hwif *hwif)
-{
- hwif->ioc_firmware_lock = bfa_ioc_ct_firmware_lock;
- hwif->ioc_firmware_unlock = bfa_ioc_ct_firmware_unlock;
- hwif->ioc_notify_fail = bfa_ioc_ct_notify_fail;
- hwif->ioc_ownership_reset = bfa_ioc_ct_ownership_reset;
- hwif->ioc_sync_start = bfa_ioc_ct_sync_start;
- hwif->ioc_sync_join = bfa_ioc_ct_sync_join;
- hwif->ioc_sync_leave = bfa_ioc_ct_sync_leave;
- hwif->ioc_sync_ack = bfa_ioc_ct_sync_ack;
- hwif->ioc_sync_complete = bfa_ioc_ct_sync_complete;
-}
+static const struct bfa_ioc_hwif nw_hwif_ct = {
+ .ioc_pll_init = bfa_ioc_ct_pll_init,
+ .ioc_firmware_lock = bfa_ioc_ct_firmware_lock,
+ .ioc_firmware_unlock = bfa_ioc_ct_firmware_unlock,
+ .ioc_reg_init = bfa_ioc_ct_reg_init,
+ .ioc_map_port = bfa_ioc_ct_map_port,
+ .ioc_isr_mode_set = bfa_ioc_ct_isr_mode_set,
+ .ioc_notify_fail = bfa_ioc_ct_notify_fail,
+ .ioc_ownership_reset = bfa_ioc_ct_ownership_reset,
+ .ioc_sync_start = bfa_ioc_ct_sync_start,
+ .ioc_sync_join = bfa_ioc_ct_sync_join,
+ .ioc_sync_leave = bfa_ioc_ct_sync_leave,
+ .ioc_sync_ack = bfa_ioc_ct_sync_ack,
+ .ioc_sync_complete = bfa_ioc_ct_sync_complete,
+};
/**
* Called from bfa_ioc_attach() to map asic specific calls.
@@ -71,12 +71,6 @@ bfa_ioc_set_ctx_hwif(struct bfa_ioc *ioc
void
bfa_nw_ioc_set_ct_hwif(struct bfa_ioc *ioc)
{
- bfa_ioc_set_ctx_hwif(ioc, &nw_hwif_ct);
-
- nw_hwif_ct.ioc_pll_init = bfa_ioc_ct_pll_init;
- nw_hwif_ct.ioc_reg_init = bfa_ioc_ct_reg_init;
- nw_hwif_ct.ioc_map_port = bfa_ioc_ct_map_port;
- nw_hwif_ct.ioc_isr_mode_set = bfa_ioc_ct_isr_mode_set;
ioc->ioc_hwif = &nw_hwif_ct;
}
--- a/drivers/net/ethernet/brocade/bna/bna.h 2011-09-16 13:35:52.257432521 -0700
+++ b/drivers/net/ethernet/brocade/bna/bna.h 2011-09-16 13:35:54.593432627 -0700
@@ -453,7 +453,7 @@ void bna_tx_res_req(int num_txq, int txq
struct bna_res_info *res_info);
struct bna_tx *bna_tx_create(struct bna *bna, struct bnad *bnad,
struct bna_tx_config *tx_cfg,
- struct bna_tx_event_cbfn *tx_cbfn,
+ const struct bna_tx_event_cbfn *tx_cbfn,
struct bna_res_info *res_info, void *priv);
void bna_tx_destroy(struct bna_tx *tx);
void bna_tx_enable(struct bna_tx *tx);
@@ -490,7 +490,7 @@ void bna_rx_res_req(struct bna_rx_config
struct bna_res_info *res_info);
struct bna_rx *bna_rx_create(struct bna *bna, struct bnad *bnad,
struct bna_rx_config *rx_cfg,
- struct bna_rx_event_cbfn *rx_cbfn,
+ const struct bna_rx_event_cbfn *rx_cbfn,
struct bna_res_info *res_info, void *priv);
void bna_rx_destroy(struct bna_rx *rx);
void bna_rx_enable(struct bna_rx *rx);
--- a/drivers/net/ethernet/brocade/bna/bnad.c 2011-09-16 13:35:52.237432520 -0700
+++ b/drivers/net/ethernet/brocade/bna/bnad.c 2011-09-16 13:35:54.597432628 -0700
@@ -1730,7 +1730,14 @@ bnad_setup_tx(struct bnad *bnad, u32 tx_
struct bna_intr_info *intr_info =
&res_info[BNA_TX_RES_INTR_T_TXCMPL].res_u.intr_info;
struct bna_tx_config *tx_config = &bnad->tx_config[tx_id];
- struct bna_tx_event_cbfn tx_cbfn;
+ static const struct bna_tx_event_cbfn tx_cbfn = {
+ .tcb_setup_cbfn = bnad_cb_tcb_setup,
+ .tcb_destroy_cbfn = bnad_cb_tcb_destroy,
+ .tx_stall_cbfn = bnad_cb_tx_stall,
+ .tx_resume_cbfn = bnad_cb_tx_resume,
+ .tx_cleanup_cbfn = bnad_cb_tx_cleanup,
+ };
+
struct bna_tx *tx;
unsigned long flags;
@@ -1742,13 +1749,6 @@ bnad_setup_tx(struct bnad *bnad, u32 tx_
tx_config->tx_type = BNA_TX_T_REGULAR;
tx_config->coalescing_timeo = bnad->tx_coalescing_timeo;
- /* Initialize the tx event handlers */
- tx_cbfn.tcb_setup_cbfn = bnad_cb_tcb_setup;
- tx_cbfn.tcb_destroy_cbfn = bnad_cb_tcb_destroy;
- tx_cbfn.tx_stall_cbfn = bnad_cb_tx_stall;
- tx_cbfn.tx_resume_cbfn = bnad_cb_tx_resume;
- tx_cbfn.tx_cleanup_cbfn = bnad_cb_tx_cleanup;
-
/* Get BNA's resource requirement for one tx object */
spin_lock_irqsave(&bnad->bna_lock, flags);
bna_tx_res_req(bnad->num_txq_per_tx,
@@ -1893,7 +1893,14 @@ bnad_setup_rx(struct bnad *bnad, u32 rx_
struct bna_intr_info *intr_info =
&res_info[BNA_RX_RES_T_INTR].res_u.intr_info;
struct bna_rx_config *rx_config = &bnad->rx_config[rx_id];
- struct bna_rx_event_cbfn rx_cbfn;
+ static const struct bna_rx_event_cbfn rx_cbfn = {
+ .rcb_setup_cbfn = bnad_cb_rcb_setup,
+ .rcb_destroy_cbfn = bnad_cb_rcb_destroy,
+ .ccb_setup_cbfn = bnad_cb_ccb_setup,
+ .ccb_destroy_cbfn = bnad_cb_ccb_destroy,
+ .rx_cleanup_cbfn = bnad_cb_rx_cleanup,
+ .rx_post_cbfn = bnad_cb_rx_post,
+ };
struct bna_rx *rx;
unsigned long flags;
@@ -1902,14 +1909,6 @@ bnad_setup_rx(struct bnad *bnad, u32 rx_
/* Initialize the Rx object configuration */
bnad_init_rx_config(bnad, rx_config);
- /* Initialize the Rx event handlers */
- rx_cbfn.rcb_setup_cbfn = bnad_cb_rcb_setup;
- rx_cbfn.rcb_destroy_cbfn = bnad_cb_rcb_destroy;
- rx_cbfn.ccb_setup_cbfn = bnad_cb_ccb_setup;
- rx_cbfn.ccb_destroy_cbfn = bnad_cb_ccb_destroy;
- rx_cbfn.rx_cleanup_cbfn = bnad_cb_rx_cleanup;
- rx_cbfn.rx_post_cbfn = bnad_cb_rx_post;
-
/* Get BNA's resource requirement for one Rx object */
spin_lock_irqsave(&bnad->bna_lock, flags);
bna_rx_res_req(rx_config, res_info);
--- a/drivers/net/ethernet/brocade/bna/bna_tx_rx.c 2011-09-16 13:36:57.733435512 -0700
+++ b/drivers/net/ethernet/brocade/bna/bna_tx_rx.c 2011-09-16 13:37:07.885435977 -0700
@@ -2305,7 +2305,7 @@ bna_rx_res_req(struct bna_rx_config *q_c
struct bna_rx *
bna_rx_create(struct bna *bna, struct bnad *bnad,
struct bna_rx_config *rx_cfg,
- struct bna_rx_event_cbfn *rx_cbfn,
+ const struct bna_rx_event_cbfn *rx_cbfn,
struct bna_res_info *res_info,
void *priv)
{
@@ -3444,7 +3444,7 @@ bna_tx_res_req(int num_txq, int txq_dept
struct bna_tx *
bna_tx_create(struct bna *bna, struct bnad *bnad,
struct bna_tx_config *tx_cfg,
- struct bna_tx_event_cbfn *tx_cbfn,
+ const struct bna_tx_event_cbfn *tx_cbfn,
struct bna_res_info *res_info, void *priv)
{
struct bna_intr_info *intr_info;
^ permalink raw reply
* [PATCH] wan: make LAPB callbacks const
From: Stephen Hemminger @ 2011-09-16 21:04 UTC (permalink / raw)
To: Krzysztof Halasa, David S. Miller; +Cc: netdev
This is compile tested only.
Suggested by dumpster diving in PAX.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
---
drivers/net/wan/hdlc_x25.c | 16 ++++++++--------
drivers/net/wan/lapbether.c | 3 +--
drivers/net/wan/x25_asy.c | 3 +--
include/linux/lapb.h | 3 ++-
include/net/lapb.h | 2 +-
net/lapb/lapb_iface.c | 29 +++++++++++++++--------------
6 files changed, 28 insertions(+), 28 deletions(-)
--- a/drivers/net/wan/hdlc_x25.c 2011-09-16 11:30:01.849087557 -0700
+++ b/drivers/net/wan/hdlc_x25.c 2011-09-16 11:31:04.901093255 -0700
@@ -134,15 +134,15 @@ static netdev_tx_t x25_xmit(struct sk_bu
static int x25_open(struct net_device *dev)
{
- struct lapb_register_struct cb;
int result;
-
- cb.connect_confirmation = x25_connected;
- cb.connect_indication = x25_connected;
- cb.disconnect_confirmation = x25_disconnected;
- cb.disconnect_indication = x25_disconnected;
- cb.data_indication = x25_data_indication;
- cb.data_transmit = x25_data_transmit;
+ static const struct lapb_register_struct cb = {
+ .connect_confirmation = x25_connected,
+ .connect_indication = x25_connected,
+ .disconnect_confirmation = x25_disconnected,
+ .disconnect_indication = x25_disconnected,
+ .data_indication = x25_data_indication,
+ .data_transmit = x25_data_transmit,
+ };
result = lapb_register(dev, &cb);
if (result != LAPB_OK)
--- a/drivers/net/wan/lapbether.c 2011-09-16 11:31:22.609091232 -0700
+++ b/drivers/net/wan/lapbether.c 2011-09-16 11:31:30.597091736 -0700
@@ -259,14 +259,13 @@ static int lapbeth_set_mac_address(struc
}
-static struct lapb_register_struct lapbeth_callbacks = {
+static const struct lapb_register_struct lapbeth_callbacks = {
.connect_confirmation = lapbeth_connected,
.connect_indication = lapbeth_connected,
.disconnect_confirmation = lapbeth_disconnected,
.disconnect_indication = lapbeth_disconnected,
.data_indication = lapbeth_data_indication,
.data_transmit = lapbeth_data_transmit,
-
};
/*
--- a/drivers/net/wan/x25_asy.c 2011-09-16 11:31:38.833091828 -0700
+++ b/drivers/net/wan/x25_asy.c 2011-09-16 11:31:46.317091608 -0700
@@ -434,14 +434,13 @@ static void x25_asy_disconnected(struct
netif_rx(skb);
}
-static struct lapb_register_struct x25_asy_callbacks = {
+static const struct lapb_register_struct x25_asy_callbacks = {
.connect_confirmation = x25_asy_connected,
.connect_indication = x25_asy_connected,
.disconnect_confirmation = x25_asy_disconnected,
.disconnect_indication = x25_asy_disconnected,
.data_indication = x25_asy_data_indication,
.data_transmit = x25_asy_data_transmit,
-
};
--- a/include/linux/lapb.h 2011-09-16 11:32:21.021093958 -0700
+++ b/include/linux/lapb.h 2011-09-16 11:38:16.593110202 -0700
@@ -44,7 +44,8 @@ struct lapb_parms_struct {
unsigned int mode;
};
-extern int lapb_register(struct net_device *dev, struct lapb_register_struct *callbacks);
+extern int lapb_register(struct net_device *dev,
+ const struct lapb_register_struct *callbacks);
extern int lapb_unregister(struct net_device *dev);
extern int lapb_getparms(struct net_device *dev, struct lapb_parms_struct *parms);
extern int lapb_setparms(struct net_device *dev, struct lapb_parms_struct *parms);
--- a/include/net/lapb.h 2011-09-16 11:32:21.037093954 -0700
+++ b/include/net/lapb.h 2011-09-16 11:34:34.361100045 -0700
@@ -95,7 +95,7 @@ struct lapb_cb {
struct sk_buff_head write_queue;
struct sk_buff_head ack_queue;
unsigned char window;
- struct lapb_register_struct callbacks;
+ const struct lapb_register_struct *callbacks;
/* FRMR control information */
struct lapb_frame frmr_data;
--- a/net/lapb/lapb_iface.c 2011-09-16 11:32:21.053093960 -0700
+++ b/net/lapb/lapb_iface.c 2011-09-16 11:38:16.593110202 -0700
@@ -139,7 +139,8 @@ out:
return lapb;
}
-int lapb_register(struct net_device *dev, struct lapb_register_struct *callbacks)
+int lapb_register(struct net_device *dev,
+ const struct lapb_register_struct *callbacks)
{
struct lapb_cb *lapb;
int rc = LAPB_BADTOKEN;
@@ -158,7 +159,7 @@ int lapb_register(struct net_device *dev
goto out;
lapb->dev = dev;
- lapb->callbacks = *callbacks;
+ lapb->callbacks = callbacks;
__lapb_insert_cb(lapb);
@@ -380,32 +381,32 @@ int lapb_data_received(struct net_device
void lapb_connect_confirmation(struct lapb_cb *lapb, int reason)
{
- if (lapb->callbacks.connect_confirmation)
- lapb->callbacks.connect_confirmation(lapb->dev, reason);
+ if (lapb->callbacks->connect_confirmation)
+ lapb->callbacks->connect_confirmation(lapb->dev, reason);
}
void lapb_connect_indication(struct lapb_cb *lapb, int reason)
{
- if (lapb->callbacks.connect_indication)
- lapb->callbacks.connect_indication(lapb->dev, reason);
+ if (lapb->callbacks->connect_indication)
+ lapb->callbacks->connect_indication(lapb->dev, reason);
}
void lapb_disconnect_confirmation(struct lapb_cb *lapb, int reason)
{
- if (lapb->callbacks.disconnect_confirmation)
- lapb->callbacks.disconnect_confirmation(lapb->dev, reason);
+ if (lapb->callbacks->disconnect_confirmation)
+ lapb->callbacks->disconnect_confirmation(lapb->dev, reason);
}
void lapb_disconnect_indication(struct lapb_cb *lapb, int reason)
{
- if (lapb->callbacks.disconnect_indication)
- lapb->callbacks.disconnect_indication(lapb->dev, reason);
+ if (lapb->callbacks->disconnect_indication)
+ lapb->callbacks->disconnect_indication(lapb->dev, reason);
}
int lapb_data_indication(struct lapb_cb *lapb, struct sk_buff *skb)
{
- if (lapb->callbacks.data_indication)
- return lapb->callbacks.data_indication(lapb->dev, skb);
+ if (lapb->callbacks->data_indication)
+ return lapb->callbacks->data_indication(lapb->dev, skb);
kfree_skb(skb);
return NET_RX_SUCCESS; /* For now; must be != NET_RX_DROP */
@@ -415,8 +416,8 @@ int lapb_data_transmit(struct lapb_cb *l
{
int used = 0;
- if (lapb->callbacks.data_transmit) {
- lapb->callbacks.data_transmit(lapb->dev, skb);
+ if (lapb->callbacks->data_transmit) {
+ lapb->callbacks->data_transmit(lapb->dev, skb);
used = 1;
}
^ permalink raw reply
* [PATCH net-next] pcnet32: constify function table
From: Stephen Hemminger @ 2011-09-16 21:06 UTC (permalink / raw)
To: Don Fry, David Miller; +Cc: netdev
Function tables need to be const to prevent malicious use.
This is compile tested only.
Gleaned from PAX.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
---
drivers/net/ethernet/amd/pcnet32.c | 202 +++++++++++++++++++++++++-------------------------
1 file changed, 101 insertions(+), 101 deletions(-)
--- a/drivers/net/ethernet/amd/pcnet32.c 2011-09-16 13:12:56.421369669 -0700
+++ b/drivers/net/ethernet/amd/pcnet32.c 2011-09-16 13:18:39.973385541 -0700
@@ -270,7 +270,7 @@ struct pcnet32_private {
struct sk_buff **rx_skbuff;
dma_addr_t *tx_dma_addr;
dma_addr_t *rx_dma_addr;
- struct pcnet32_access a;
+ const struct pcnet32_access *a;
spinlock_t lock; /* Guard lock */
unsigned int cur_rx, cur_tx; /* The next free ring entry */
unsigned int rx_ring_size; /* current rx ring size */
@@ -379,7 +379,7 @@ static int pcnet32_wio_check(unsigned lo
return inw(addr + PCNET32_WIO_RAP) == 88;
}
-static struct pcnet32_access pcnet32_wio = {
+static const struct pcnet32_access pcnet32_wio = {
.read_csr = pcnet32_wio_read_csr,
.write_csr = pcnet32_wio_write_csr,
.read_bcr = pcnet32_wio_read_bcr,
@@ -434,7 +434,7 @@ static int pcnet32_dwio_check(unsigned l
return (inl(addr + PCNET32_DWIO_RAP) & 0xffff) == 88;
}
-static struct pcnet32_access pcnet32_dwio = {
+static const struct pcnet32_access pcnet32_dwio = {
.read_csr = pcnet32_dwio_read_csr,
.write_csr = pcnet32_dwio_write_csr,
.read_bcr = pcnet32_dwio_read_bcr,
@@ -460,9 +460,9 @@ static void pcnet32_netif_start(struct n
u16 val;
netif_wake_queue(dev);
- val = lp->a.read_csr(ioaddr, CSR3);
+ val = lp->a->read_csr(ioaddr, CSR3);
val &= 0x00ff;
- lp->a.write_csr(ioaddr, CSR3, val);
+ lp->a->write_csr(ioaddr, CSR3, val);
napi_enable(&lp->napi);
}
@@ -730,7 +730,7 @@ static u32 pcnet32_get_link(struct net_d
r = mii_link_ok(&lp->mii_if);
} else if (lp->chip_version >= PCNET32_79C970A) {
ulong ioaddr = dev->base_addr; /* card base I/O address */
- r = (lp->a.read_bcr(ioaddr, 4) != 0xc0);
+ r = (lp->a->read_bcr(ioaddr, 4) != 0xc0);
} else { /* can not detect link on really old chips */
r = 1;
}
@@ -792,7 +792,7 @@ static int pcnet32_set_ringparam(struct
pcnet32_netif_stop(dev);
spin_lock_irqsave(&lp->lock, flags);
- lp->a.write_csr(ioaddr, CSR0, CSR0_STOP); /* stop the chip */
+ lp->a->write_csr(ioaddr, CSR0, CSR0_STOP); /* stop the chip */
size = min(ering->tx_pending, (unsigned int)TX_MAX_RING_SIZE);
@@ -868,7 +868,7 @@ static void pcnet32_ethtool_test(struct
static int pcnet32_loopback_test(struct net_device *dev, uint64_t * data1)
{
struct pcnet32_private *lp = netdev_priv(dev);
- struct pcnet32_access *a = &lp->a; /* access to registers */
+ const struct pcnet32_access *a = lp->a; /* access to registers */
ulong ioaddr = dev->base_addr; /* card base I/O address */
struct sk_buff *skb; /* sk buff */
int x, i; /* counters */
@@ -888,21 +888,21 @@ static int pcnet32_loopback_test(struct
pcnet32_netif_stop(dev);
spin_lock_irqsave(&lp->lock, flags);
- lp->a.write_csr(ioaddr, CSR0, CSR0_STOP); /* stop the chip */
+ lp->a->write_csr(ioaddr, CSR0, CSR0_STOP); /* stop the chip */
numbuffs = min(numbuffs, (int)min(lp->rx_ring_size, lp->tx_ring_size));
/* Reset the PCNET32 */
- lp->a.reset(ioaddr);
- lp->a.write_csr(ioaddr, CSR4, 0x0915); /* auto tx pad */
+ lp->a->reset(ioaddr);
+ lp->a->write_csr(ioaddr, CSR4, 0x0915); /* auto tx pad */
/* switch pcnet32 to 32bit mode */
- lp->a.write_bcr(ioaddr, 20, 2);
+ lp->a->write_bcr(ioaddr, 20, 2);
/* purge & init rings but don't actually restart */
pcnet32_restart(dev, 0x0000);
- lp->a.write_csr(ioaddr, CSR0, CSR0_STOP); /* Set STOP bit */
+ lp->a->write_csr(ioaddr, CSR0, CSR0_STOP); /* Set STOP bit */
/* Initialize Transmit buffers. */
size = data_len + 15;
@@ -947,10 +947,10 @@ static int pcnet32_loopback_test(struct
/* set int loopback in CSR15 */
x = a->read_csr(ioaddr, CSR15) & 0xfffc;
- lp->a.write_csr(ioaddr, CSR15, x | 0x0044);
+ lp->a->write_csr(ioaddr, CSR15, x | 0x0044);
teststatus = cpu_to_le16(0x8000);
- lp->a.write_csr(ioaddr, CSR0, CSR0_START); /* Set STRT bit */
+ lp->a->write_csr(ioaddr, CSR0, CSR0_START); /* Set STRT bit */
/* Check status of descriptors */
for (x = 0; x < numbuffs; x++) {
@@ -969,7 +969,7 @@ static int pcnet32_loopback_test(struct
}
}
- lp->a.write_csr(ioaddr, CSR0, CSR0_STOP); /* Set STOP bit */
+ lp->a->write_csr(ioaddr, CSR0, CSR0_STOP); /* Set STOP bit */
wmb();
if (netif_msg_hw(lp) && netif_msg_pktdata(lp)) {
netdev_printk(KERN_DEBUG, dev, "RX loopback packets:\n");
@@ -1015,7 +1015,7 @@ clean_up:
pcnet32_restart(dev, CSR0_NORMAL);
} else {
pcnet32_purge_rx_ring(dev);
- lp->a.write_bcr(ioaddr, 20, 4); /* return to 16bit mode */
+ lp->a->write_bcr(ioaddr, 20, 4); /* return to 16bit mode */
}
spin_unlock_irqrestore(&lp->lock, flags);
@@ -1026,7 +1026,7 @@ static int pcnet32_set_phys_id(struct ne
enum ethtool_phys_id_state state)
{
struct pcnet32_private *lp = netdev_priv(dev);
- struct pcnet32_access *a = &lp->a;
+ const struct pcnet32_access *a = lp->a;
ulong ioaddr = dev->base_addr;
unsigned long flags;
int i;
@@ -1067,7 +1067,7 @@ static int pcnet32_suspend(struct net_de
{
int csr5;
struct pcnet32_private *lp = netdev_priv(dev);
- struct pcnet32_access *a = &lp->a;
+ const struct pcnet32_access *a = lp->a;
ulong ioaddr = dev->base_addr;
int ticks;
@@ -1324,8 +1324,8 @@ static int pcnet32_poll(struct napi_stru
spin_lock_irqsave(&lp->lock, flags);
if (pcnet32_tx(dev)) {
/* reset the chip to clear the error condition, then restart */
- lp->a.reset(ioaddr);
- lp->a.write_csr(ioaddr, CSR4, 0x0915); /* auto tx pad */
+ lp->a->reset(ioaddr);
+ lp->a->write_csr(ioaddr, CSR4, 0x0915); /* auto tx pad */
pcnet32_restart(dev, CSR0_START);
netif_wake_queue(dev);
}
@@ -1337,12 +1337,12 @@ static int pcnet32_poll(struct napi_stru
__napi_complete(napi);
/* clear interrupt masks */
- val = lp->a.read_csr(ioaddr, CSR3);
+ val = lp->a->read_csr(ioaddr, CSR3);
val &= 0x00ff;
- lp->a.write_csr(ioaddr, CSR3, val);
+ lp->a->write_csr(ioaddr, CSR3, val);
/* Set interrupt enable. */
- lp->a.write_csr(ioaddr, CSR0, CSR0_INTEN);
+ lp->a->write_csr(ioaddr, CSR0, CSR0_INTEN);
spin_unlock_irqrestore(&lp->lock, flags);
}
@@ -1365,7 +1365,7 @@ static void pcnet32_get_regs(struct net_
int i, csr0;
u16 *buff = ptr;
struct pcnet32_private *lp = netdev_priv(dev);
- struct pcnet32_access *a = &lp->a;
+ const struct pcnet32_access *a = lp->a;
ulong ioaddr = dev->base_addr;
unsigned long flags;
@@ -1401,9 +1401,9 @@ static void pcnet32_get_regs(struct net_
for (j = 0; j < PCNET32_MAX_PHYS; j++) {
if (lp->phymask & (1 << j)) {
for (i = 0; i < PCNET32_REGS_PER_PHY; i++) {
- lp->a.write_bcr(ioaddr, 33,
+ lp->a->write_bcr(ioaddr, 33,
(j << 5) | i);
- *buff++ = lp->a.read_bcr(ioaddr, 34);
+ *buff++ = lp->a->read_bcr(ioaddr, 34);
}
}
}
@@ -1528,7 +1528,7 @@ pcnet32_probe1(unsigned long ioaddr, int
int chip_version;
char *chipname;
struct net_device *dev;
- struct pcnet32_access *a = NULL;
+ const struct pcnet32_access *a = NULL;
u8 promaddr[6];
int ret = -ENODEV;
@@ -1785,7 +1785,7 @@ pcnet32_probe1(unsigned long ioaddr, int
((cards_found >= MAX_UNITS) || full_duplex[cards_found]))
lp->options |= PCNET32_PORT_FD;
- lp->a = *a;
+ lp->a = a;
/* prior to register_netdev, dev->name is not yet correct */
if (pcnet32_alloc_ring(dev, pci_name(lp->pci_dev))) {
@@ -1844,7 +1844,7 @@ pcnet32_probe1(unsigned long ioaddr, int
if (lp->mii) {
/* lp->phycount and lp->phymask are set to 0 by memset above */
- lp->mii_if.phy_id = ((lp->a.read_bcr(ioaddr, 33)) >> 5) & 0x1f;
+ lp->mii_if.phy_id = ((lp->a->read_bcr(ioaddr, 33)) >> 5) & 0x1f;
/* scan for PHYs */
for (i = 0; i < PCNET32_MAX_PHYS; i++) {
unsigned short id1, id2;
@@ -1864,7 +1864,7 @@ pcnet32_probe1(unsigned long ioaddr, int
pr_info("Found PHY %04x:%04x at address %d\n",
id1, id2, i);
}
- lp->a.write_bcr(ioaddr, 33, (lp->mii_if.phy_id) << 5);
+ lp->a->write_bcr(ioaddr, 33, (lp->mii_if.phy_id) << 5);
if (lp->phycount > 1)
lp->options |= PCNET32_PORT_MII;
}
@@ -2020,10 +2020,10 @@ static int pcnet32_open(struct net_devic
}
/* Reset the PCNET32 */
- lp->a.reset(ioaddr);
+ lp->a->reset(ioaddr);
/* switch pcnet32 to 32bit mode */
- lp->a.write_bcr(ioaddr, 20, 2);
+ lp->a->write_bcr(ioaddr, 20, 2);
netif_printk(lp, ifup, KERN_DEBUG, dev,
"%s() irq %d tx/rx rings %#x/%#x init %#x\n",
@@ -2032,14 +2032,14 @@ static int pcnet32_open(struct net_devic
(u32) (lp->init_dma_addr));
/* set/reset autoselect bit */
- val = lp->a.read_bcr(ioaddr, 2) & ~2;
+ val = lp->a->read_bcr(ioaddr, 2) & ~2;
if (lp->options & PCNET32_PORT_ASEL)
val |= 2;
- lp->a.write_bcr(ioaddr, 2, val);
+ lp->a->write_bcr(ioaddr, 2, val);
/* handle full duplex setting */
if (lp->mii_if.full_duplex) {
- val = lp->a.read_bcr(ioaddr, 9) & ~3;
+ val = lp->a->read_bcr(ioaddr, 9) & ~3;
if (lp->options & PCNET32_PORT_FD) {
val |= 1;
if (lp->options == (PCNET32_PORT_FD | PCNET32_PORT_AUI))
@@ -2049,14 +2049,14 @@ static int pcnet32_open(struct net_devic
if (lp->chip_version == 0x2627)
val |= 3;
}
- lp->a.write_bcr(ioaddr, 9, val);
+ lp->a->write_bcr(ioaddr, 9, val);
}
/* set/reset GPSI bit in test register */
- val = lp->a.read_csr(ioaddr, 124) & ~0x10;
+ val = lp->a->read_csr(ioaddr, 124) & ~0x10;
if ((lp->options & PCNET32_PORT_PORTSEL) == PCNET32_PORT_GPSI)
val |= 0x10;
- lp->a.write_csr(ioaddr, 124, val);
+ lp->a->write_csr(ioaddr, 124, val);
/* Allied Telesyn AT 2700/2701 FX are 100Mbit only and do not negotiate */
if (pdev && pdev->subsystem_vendor == PCI_VENDOR_ID_AT &&
@@ -2075,24 +2075,24 @@ static int pcnet32_open(struct net_devic
* duplex, and/or enable auto negotiation, and clear DANAS
*/
if (lp->mii && !(lp->options & PCNET32_PORT_ASEL)) {
- lp->a.write_bcr(ioaddr, 32,
- lp->a.read_bcr(ioaddr, 32) | 0x0080);
+ lp->a->write_bcr(ioaddr, 32,
+ lp->a->read_bcr(ioaddr, 32) | 0x0080);
/* disable Auto Negotiation, set 10Mpbs, HD */
- val = lp->a.read_bcr(ioaddr, 32) & ~0xb8;
+ val = lp->a->read_bcr(ioaddr, 32) & ~0xb8;
if (lp->options & PCNET32_PORT_FD)
val |= 0x10;
if (lp->options & PCNET32_PORT_100)
val |= 0x08;
- lp->a.write_bcr(ioaddr, 32, val);
+ lp->a->write_bcr(ioaddr, 32, val);
} else {
if (lp->options & PCNET32_PORT_ASEL) {
- lp->a.write_bcr(ioaddr, 32,
- lp->a.read_bcr(ioaddr,
+ lp->a->write_bcr(ioaddr, 32,
+ lp->a->read_bcr(ioaddr,
32) | 0x0080);
/* enable auto negotiate, setup, disable fd */
- val = lp->a.read_bcr(ioaddr, 32) & ~0x98;
+ val = lp->a->read_bcr(ioaddr, 32) & ~0x98;
val |= 0x20;
- lp->a.write_bcr(ioaddr, 32, val);
+ lp->a->write_bcr(ioaddr, 32, val);
}
}
} else {
@@ -2105,10 +2105,10 @@ static int pcnet32_open(struct net_devic
* There is really no good other way to handle multiple PHYs
* other than turning off all automatics
*/
- val = lp->a.read_bcr(ioaddr, 2);
- lp->a.write_bcr(ioaddr, 2, val & ~2);
- val = lp->a.read_bcr(ioaddr, 32);
- lp->a.write_bcr(ioaddr, 32, val & ~(1 << 7)); /* stop MII manager */
+ val = lp->a->read_bcr(ioaddr, 2);
+ lp->a->write_bcr(ioaddr, 2, val & ~2);
+ val = lp->a->read_bcr(ioaddr, 32);
+ lp->a->write_bcr(ioaddr, 32, val & ~(1 << 7)); /* stop MII manager */
if (!(lp->options & PCNET32_PORT_ASEL)) {
/* setup ecmd */
@@ -2118,7 +2118,7 @@ static int pcnet32_open(struct net_devic
ethtool_cmd_speed_set(&ecmd,
(lp->options & PCNET32_PORT_100) ?
SPEED_100 : SPEED_10);
- bcr9 = lp->a.read_bcr(ioaddr, 9);
+ bcr9 = lp->a->read_bcr(ioaddr, 9);
if (lp->options & PCNET32_PORT_FD) {
ecmd.duplex = DUPLEX_FULL;
@@ -2127,7 +2127,7 @@ static int pcnet32_open(struct net_devic
ecmd.duplex = DUPLEX_HALF;
bcr9 |= ~(1 << 0);
}
- lp->a.write_bcr(ioaddr, 9, bcr9);
+ lp->a->write_bcr(ioaddr, 9, bcr9);
}
for (i = 0; i < PCNET32_MAX_PHYS; i++) {
@@ -2158,9 +2158,9 @@ static int pcnet32_open(struct net_devic
#ifdef DO_DXSUFLO
if (lp->dxsuflo) { /* Disable transmit stop on underflow */
- val = lp->a.read_csr(ioaddr, CSR3);
+ val = lp->a->read_csr(ioaddr, CSR3);
val |= 0x40;
- lp->a.write_csr(ioaddr, CSR3, val);
+ lp->a->write_csr(ioaddr, CSR3, val);
}
#endif
@@ -2176,11 +2176,11 @@ static int pcnet32_open(struct net_devic
napi_enable(&lp->napi);
/* Re-initialize the PCNET32, and start it when done. */
- lp->a.write_csr(ioaddr, 1, (lp->init_dma_addr & 0xffff));
- lp->a.write_csr(ioaddr, 2, (lp->init_dma_addr >> 16));
+ lp->a->write_csr(ioaddr, 1, (lp->init_dma_addr & 0xffff));
+ lp->a->write_csr(ioaddr, 2, (lp->init_dma_addr >> 16));
- lp->a.write_csr(ioaddr, CSR4, 0x0915); /* auto tx pad */
- lp->a.write_csr(ioaddr, CSR0, CSR0_INIT);
+ lp->a->write_csr(ioaddr, CSR4, 0x0915); /* auto tx pad */
+ lp->a->write_csr(ioaddr, CSR0, CSR0_INIT);
netif_start_queue(dev);
@@ -2192,19 +2192,19 @@ static int pcnet32_open(struct net_devic
i = 0;
while (i++ < 100)
- if (lp->a.read_csr(ioaddr, CSR0) & CSR0_IDON)
+ if (lp->a->read_csr(ioaddr, CSR0) & CSR0_IDON)
break;
/*
* We used to clear the InitDone bit, 0x0100, here but Mark Stockton
* reports that doing so triggers a bug in the '974.
*/
- lp->a.write_csr(ioaddr, CSR0, CSR0_NORMAL);
+ lp->a->write_csr(ioaddr, CSR0, CSR0_NORMAL);
netif_printk(lp, ifup, KERN_DEBUG, dev,
"pcnet32 open after %d ticks, init block %#x csr0 %4.4x\n",
i,
(u32) (lp->init_dma_addr),
- lp->a.read_csr(ioaddr, CSR0));
+ lp->a->read_csr(ioaddr, CSR0));
spin_unlock_irqrestore(&lp->lock, flags);
@@ -2218,7 +2218,7 @@ err_free_ring:
* Switch back to 16bit mode to avoid problems with dumb
* DOS packet driver after a warm reboot
*/
- lp->a.write_bcr(ioaddr, 20, 4);
+ lp->a->write_bcr(ioaddr, 20, 4);
err_free_irq:
spin_unlock_irqrestore(&lp->lock, flags);
@@ -2323,7 +2323,7 @@ static void pcnet32_restart(struct net_d
/* wait for stop */
for (i = 0; i < 100; i++)
- if (lp->a.read_csr(ioaddr, CSR0) & CSR0_STOP)
+ if (lp->a->read_csr(ioaddr, CSR0) & CSR0_STOP)
break;
if (i >= 100)
@@ -2335,13 +2335,13 @@ static void pcnet32_restart(struct net_d
return;
/* ReInit Ring */
- lp->a.write_csr(ioaddr, CSR0, CSR0_INIT);
+ lp->a->write_csr(ioaddr, CSR0, CSR0_INIT);
i = 0;
while (i++ < 1000)
- if (lp->a.read_csr(ioaddr, CSR0) & CSR0_IDON)
+ if (lp->a->read_csr(ioaddr, CSR0) & CSR0_IDON)
break;
- lp->a.write_csr(ioaddr, CSR0, csr0_bits);
+ lp->a->write_csr(ioaddr, CSR0, csr0_bits);
}
static void pcnet32_tx_timeout(struct net_device *dev)
@@ -2353,8 +2353,8 @@ static void pcnet32_tx_timeout(struct ne
/* Transmitter timeout, serious problems. */
if (pcnet32_debug & NETIF_MSG_DRV)
pr_err("%s: transmit timed out, status %4.4x, resetting\n",
- dev->name, lp->a.read_csr(ioaddr, CSR0));
- lp->a.write_csr(ioaddr, CSR0, CSR0_STOP);
+ dev->name, lp->a->read_csr(ioaddr, CSR0));
+ lp->a->write_csr(ioaddr, CSR0, CSR0_STOP);
dev->stats.tx_errors++;
if (netif_msg_tx_err(lp)) {
int i;
@@ -2397,7 +2397,7 @@ static netdev_tx_t pcnet32_start_xmit(st
netif_printk(lp, tx_queued, KERN_DEBUG, dev,
"%s() called, csr0 %4.4x\n",
- __func__, lp->a.read_csr(ioaddr, CSR0));
+ __func__, lp->a->read_csr(ioaddr, CSR0));
/* Default status -- will not enable Successful-TxDone
* interrupt when that option is available to us.
@@ -2427,7 +2427,7 @@ static netdev_tx_t pcnet32_start_xmit(st
dev->stats.tx_bytes += skb->len;
/* Trigger an immediate send poll. */
- lp->a.write_csr(ioaddr, CSR0, CSR0_INTEN | CSR0_TXPOLL);
+ lp->a->write_csr(ioaddr, CSR0, CSR0_INTEN | CSR0_TXPOLL);
if (lp->tx_ring[(entry + 1) & lp->tx_mod_mask].base != 0) {
lp->tx_full = 1;
@@ -2452,16 +2452,16 @@ pcnet32_interrupt(int irq, void *dev_id)
spin_lock(&lp->lock);
- csr0 = lp->a.read_csr(ioaddr, CSR0);
+ csr0 = lp->a->read_csr(ioaddr, CSR0);
while ((csr0 & 0x8f00) && --boguscnt >= 0) {
if (csr0 == 0xffff)
break; /* PCMCIA remove happened */
/* Acknowledge all of the current interrupt sources ASAP. */
- lp->a.write_csr(ioaddr, CSR0, csr0 & ~0x004f);
+ lp->a->write_csr(ioaddr, CSR0, csr0 & ~0x004f);
netif_printk(lp, intr, KERN_DEBUG, dev,
"interrupt csr0=%#2.2x new csr=%#2.2x\n",
- csr0, lp->a.read_csr(ioaddr, CSR0));
+ csr0, lp->a->read_csr(ioaddr, CSR0));
/* Log misc errors. */
if (csr0 & 0x4000)
@@ -2488,19 +2488,19 @@ pcnet32_interrupt(int irq, void *dev_id)
if (napi_schedule_prep(&lp->napi)) {
u16 val;
/* set interrupt masks */
- val = lp->a.read_csr(ioaddr, CSR3);
+ val = lp->a->read_csr(ioaddr, CSR3);
val |= 0x5f00;
- lp->a.write_csr(ioaddr, CSR3, val);
+ lp->a->write_csr(ioaddr, CSR3, val);
__napi_schedule(&lp->napi);
break;
}
- csr0 = lp->a.read_csr(ioaddr, CSR0);
+ csr0 = lp->a->read_csr(ioaddr, CSR0);
}
netif_printk(lp, intr, KERN_DEBUG, dev,
"exiting interrupt, csr0=%#4.4x\n",
- lp->a.read_csr(ioaddr, CSR0));
+ lp->a->read_csr(ioaddr, CSR0));
spin_unlock(&lp->lock);
@@ -2520,20 +2520,20 @@ static int pcnet32_close(struct net_devi
spin_lock_irqsave(&lp->lock, flags);
- dev->stats.rx_missed_errors = lp->a.read_csr(ioaddr, 112);
+ dev->stats.rx_missed_errors = lp->a->read_csr(ioaddr, 112);
netif_printk(lp, ifdown, KERN_DEBUG, dev,
"Shutting down ethercard, status was %2.2x\n",
- lp->a.read_csr(ioaddr, CSR0));
+ lp->a->read_csr(ioaddr, CSR0));
/* We stop the PCNET32 here -- it occasionally polls memory if we don't. */
- lp->a.write_csr(ioaddr, CSR0, CSR0_STOP);
+ lp->a->write_csr(ioaddr, CSR0, CSR0_STOP);
/*
* Switch back to 16bit mode to avoid problems with dumb
* DOS packet driver after a warm reboot
*/
- lp->a.write_bcr(ioaddr, 20, 4);
+ lp->a->write_bcr(ioaddr, 20, 4);
spin_unlock_irqrestore(&lp->lock, flags);
@@ -2556,7 +2556,7 @@ static struct net_device_stats *pcnet32_
unsigned long flags;
spin_lock_irqsave(&lp->lock, flags);
- dev->stats.rx_missed_errors = lp->a.read_csr(ioaddr, 112);
+ dev->stats.rx_missed_errors = lp->a->read_csr(ioaddr, 112);
spin_unlock_irqrestore(&lp->lock, flags);
return &dev->stats;
@@ -2577,10 +2577,10 @@ static void pcnet32_load_multicast(struc
if (dev->flags & IFF_ALLMULTI) {
ib->filter[0] = cpu_to_le32(~0U);
ib->filter[1] = cpu_to_le32(~0U);
- lp->a.write_csr(ioaddr, PCNET32_MC_FILTER, 0xffff);
- lp->a.write_csr(ioaddr, PCNET32_MC_FILTER+1, 0xffff);
- lp->a.write_csr(ioaddr, PCNET32_MC_FILTER+2, 0xffff);
- lp->a.write_csr(ioaddr, PCNET32_MC_FILTER+3, 0xffff);
+ lp->a->write_csr(ioaddr, PCNET32_MC_FILTER, 0xffff);
+ lp->a->write_csr(ioaddr, PCNET32_MC_FILTER+1, 0xffff);
+ lp->a->write_csr(ioaddr, PCNET32_MC_FILTER+2, 0xffff);
+ lp->a->write_csr(ioaddr, PCNET32_MC_FILTER+3, 0xffff);
return;
}
/* clear the multicast filter */
@@ -2594,7 +2594,7 @@ static void pcnet32_load_multicast(struc
mcast_table[crc >> 4] |= cpu_to_le16(1 << (crc & 0xf));
}
for (i = 0; i < 4; i++)
- lp->a.write_csr(ioaddr, PCNET32_MC_FILTER + i,
+ lp->a->write_csr(ioaddr, PCNET32_MC_FILTER + i,
le16_to_cpu(mcast_table[i]));
}
@@ -2609,28 +2609,28 @@ static void pcnet32_set_multicast_list(s
spin_lock_irqsave(&lp->lock, flags);
suspended = pcnet32_suspend(dev, &flags, 0);
- csr15 = lp->a.read_csr(ioaddr, CSR15);
+ csr15 = lp->a->read_csr(ioaddr, CSR15);
if (dev->flags & IFF_PROMISC) {
/* Log any net taps. */
netif_info(lp, hw, dev, "Promiscuous mode enabled\n");
lp->init_block->mode =
cpu_to_le16(0x8000 | (lp->options & PCNET32_PORT_PORTSEL) <<
7);
- lp->a.write_csr(ioaddr, CSR15, csr15 | 0x8000);
+ lp->a->write_csr(ioaddr, CSR15, csr15 | 0x8000);
} else {
lp->init_block->mode =
cpu_to_le16((lp->options & PCNET32_PORT_PORTSEL) << 7);
- lp->a.write_csr(ioaddr, CSR15, csr15 & 0x7fff);
+ lp->a->write_csr(ioaddr, CSR15, csr15 & 0x7fff);
pcnet32_load_multicast(dev);
}
if (suspended) {
int csr5;
/* clear SUSPEND (SPND) - CSR5 bit 0 */
- csr5 = lp->a.read_csr(ioaddr, CSR5);
- lp->a.write_csr(ioaddr, CSR5, csr5 & (~CSR5_SUSPEND));
+ csr5 = lp->a->read_csr(ioaddr, CSR5);
+ lp->a->write_csr(ioaddr, CSR5, csr5 & (~CSR5_SUSPEND));
} else {
- lp->a.write_csr(ioaddr, CSR0, CSR0_STOP);
+ lp->a->write_csr(ioaddr, CSR0, CSR0_STOP);
pcnet32_restart(dev, CSR0_NORMAL);
netif_wake_queue(dev);
}
@@ -2648,8 +2648,8 @@ static int mdio_read(struct net_device *
if (!lp->mii)
return 0;
- lp->a.write_bcr(ioaddr, 33, ((phy_id & 0x1f) << 5) | (reg_num & 0x1f));
- val_out = lp->a.read_bcr(ioaddr, 34);
+ lp->a->write_bcr(ioaddr, 33, ((phy_id & 0x1f) << 5) | (reg_num & 0x1f));
+ val_out = lp->a->read_bcr(ioaddr, 34);
return val_out;
}
@@ -2663,8 +2663,8 @@ static void mdio_write(struct net_device
if (!lp->mii)
return;
- lp->a.write_bcr(ioaddr, 33, ((phy_id & 0x1f) << 5) | (reg_num & 0x1f));
- lp->a.write_bcr(ioaddr, 34, val);
+ lp->a->write_bcr(ioaddr, 33, ((phy_id & 0x1f) << 5) | (reg_num & 0x1f));
+ lp->a->write_bcr(ioaddr, 34, val);
}
static int pcnet32_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
@@ -2741,7 +2741,7 @@ static void pcnet32_check_media(struct n
curr_link = mii_link_ok(&lp->mii_if);
} else {
ulong ioaddr = dev->base_addr; /* card base I/O address */
- curr_link = (lp->a.read_bcr(ioaddr, 4) != 0xc0);
+ curr_link = (lp->a->read_bcr(ioaddr, 4) != 0xc0);
}
if (!curr_link) {
if (prev_link || verbose) {
@@ -2764,13 +2764,13 @@ static void pcnet32_check_media(struct n
(ecmd.duplex == DUPLEX_FULL)
? "full" : "half");
}
- bcr9 = lp->a.read_bcr(dev->base_addr, 9);
+ bcr9 = lp->a->read_bcr(dev->base_addr, 9);
if ((bcr9 & (1 << 0)) != lp->mii_if.full_duplex) {
if (lp->mii_if.full_duplex)
bcr9 |= (1 << 0);
else
bcr9 &= ~(1 << 0);
- lp->a.write_bcr(dev->base_addr, 9, bcr9);
+ lp->a->write_bcr(dev->base_addr, 9, bcr9);
}
} else {
netif_info(lp, link, dev, "link up\n");
^ permalink raw reply
* Re: [PATCH 0/4] ibmveth fixes
From: Anton Blanchard @ 2011-09-16 20:51 UTC (permalink / raw)
To: David Miller; +Cc: santil, brking, rcj, netdev
In-Reply-To: <20110916.152803.861340383634129942.davem@davemloft.net>
Hi Dave,
> All applied.
Thanks!
> I love those "ret1", "ret2", "ret3", "ret4" variables.
>
> Each successive number in the names gives such incredible
> insight into the meaning and usage of the individual
> variables, making it painless for reviewers to understand
> this code.
:) That function needs to be simplified and rewritten, it took me a
while to get my head around it.
Anton
^ permalink raw reply
* Re: [PATCH 1/2] sfc: Remove requirement to set tx-usecs-irq for shared channels when modifying coalescing parameters
From: David Miller @ 2011-09-16 20:51 UTC (permalink / raw)
To: bhutchings; +Cc: ripduman.sohan, linux-net-drivers, shodgson, netdev
In-Reply-To: <1315231921.3028.11.camel@bwh-desktop>
From: Ben Hutchings <bhutchings@solarflare.com>
Date: Mon, 05 Sep 2011 15:12:01 +0100
> So I have some changes of my own in preparation, which I'll send as
> follow-ups.
Ben, just FYI, I have applied those follow-up patches to SFC.
Thanks.
^ permalink raw reply
* Re: [PATCH 0/4] ibmveth fixes
From: David Miller @ 2011-09-16 19:28 UTC (permalink / raw)
To: anton; +Cc: santil, brking, rcj, netdev
In-Reply-To: <20110908004102.355674129@samba.org>
From: Anton Blanchard <anton@samba.org>
Date: Thu, 08 Sep 2011 10:41:02 +1000
> Here are a number of fixes found during ibmveth testing.
All applied.
I love those "ret1", "ret2", "ret3", "ret4" variables.
Each successive number in the names gives such incredible
insight into the meaning and usage of the individual
variables, making it painless for reviewers to understand
this code.
^ permalink raw reply
* Re: pull request: wireless-next 2011-09-16
From: David Miller @ 2011-09-16 19:20 UTC (permalink / raw)
To: linville; +Cc: linux-wireless, netdev
In-Reply-To: <20110916183118.GB22612@tuxdriver.com>
From: "John W. Linville" <linville@tuxdriver.com>
Date: Fri, 16 Sep 2011 14:31:19 -0400
> This is a batch of updates intended for 3.2. They have been simmering
> for a while, since I merged them just before the big kernel.org
> shutdown. That includes time in wireless-testing and linux-next
> (albeit the latter is diminished by the kernel.org outage). For now,
> I am just trying to clear the backlog... :-)
>
> This includes a sizable wl12xx pull and a bunch of iwlagn updates.
> There are also a number of ath9k updates, some b43 updates, and a
> handful of other bits.
>
> Please let me know if there are problems!
Pulled, thanks John.
^ permalink raw reply
* Re: [net-next 00/11][pull request] Intel Wired LAN Driver Updates
From: David Miller @ 2011-09-16 19:20 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: netdev, gospo
In-Reply-To: <1316148173-11209-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Thu, 15 Sep 2011 21:42:42 -0700
> The following series contains updates to ixgbe only. These are primarily
> cleanups of the ixgbe driver. The first two patches of the series:
>
> ixgbe: Change default Tx work limit size to 256 buffers
> ixgbe: consolidate all MSI-X ring interrupts and poll routines into one
>
> are re-worked based on previous community feedback (Dave and Ben).
>
> The following are changes since commit 4bc71cb983fd2844e603bf633df2bb53385182d2:
> net: consolidate and fix ethtool_ops->get_settings calling
> and are available in the git repository at:
> git://github.com/Jkirsher/net-next.git
Pulled, thanks Jeff.
^ permalink raw reply
* Re: [PATCH] can: ti_hecc: include linux/io.h
From: Wolfgang Grandegger @ 2011-09-16 19:18 UTC (permalink / raw)
To: Daniel Mack; +Cc: linux-kernel, netdev
In-Reply-To: <1316195863-18695-1-git-send-email-zonque@gmail.com>
On 09/16/2011 07:57 PM, Daniel Mack wrote:
> This fixes a build breakage for OMAP3 boards.
>
> Signed-off-by: Daniel Mack <zonque@gmail.com>
> Cc: Wolfgang Grandegger <wg@grandegger.com>
> Cc: netdev@vger.kernel.org
Acked-by: Wolfgang Grandegger <wg@grandegger.com>
Thanks.
Wolfgang.
^ permalink raw reply
* [PATCH] IRDA: Fix global type conflicts in net/irda/irsysctl.c v2
From: Andi Kleen @ 2011-09-16 19:09 UTC (permalink / raw)
To: davem; +Cc: samuel, netdev, Andi Kleen
From: Andi Kleen <ak@linux.intel.com>
The externs here didn't agree with the declarations in qos.c.
Better would be probably to move this into a header, but since it's
common practice to have naked externs with sysctls I left it for now.
v2: add some redundancy
Cc: samuel@sortiz.org
Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
net/irda/irsysctl.c | 6 +++---
net/irda/qos.c | 6 +++---
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/net/irda/irsysctl.c b/net/irda/irsysctl.c
index d0b70da..2615ffc 100644
--- a/net/irda/irsysctl.c
+++ b/net/irda/irsysctl.c
@@ -40,9 +40,9 @@ extern int sysctl_slot_timeout;
extern int sysctl_fast_poll_increase;
extern char sysctl_devname[];
extern int sysctl_max_baud_rate;
-extern int sysctl_min_tx_turn_time;
-extern int sysctl_max_tx_data_size;
-extern int sysctl_max_tx_window;
+extern unsigned int sysctl_min_tx_turn_time;
+extern unsigned int sysctl_max_tx_data_size;
+extern unsigned int sysctl_max_tx_window;
extern int sysctl_max_noreply_time;
extern int sysctl_warn_noreply_time;
extern int sysctl_lap_keepalive_time;
diff --git a/net/irda/qos.c b/net/irda/qos.c
index 1b51bcf..4369f7f 100644
--- a/net/irda/qos.c
+++ b/net/irda/qos.c
@@ -60,7 +60,7 @@ int sysctl_max_noreply_time = 12;
* Default is 10us which means using the unmodified value given by the
* peer except if it's 0 (0 is likely a bug in the other stack).
*/
-unsigned sysctl_min_tx_turn_time = 10;
+unsigned int sysctl_min_tx_turn_time = 10;
/*
* Maximum data size to be used in transmission in payload of LAP frame.
* There is a bit of confusion in the IrDA spec :
@@ -75,13 +75,13 @@ unsigned sysctl_min_tx_turn_time = 10;
* bytes frames or all negotiated frame sizes, but you can use the sysctl
* to play with this value anyway.
* Jean II */
-unsigned sysctl_max_tx_data_size = 2042;
+unsigned int sysctl_max_tx_data_size = 2042;
/*
* Maximum transmit window, i.e. number of LAP frames between turn-around.
* This allow to override what the peer told us. Some peers are buggy and
* don't always support what they tell us.
* Jean II */
-unsigned sysctl_max_tx_window = 7;
+unsigned int sysctl_max_tx_window = 7;
static int irlap_param_baud_rate(void *instance, irda_param_t *param, int get);
static int irlap_param_link_disconnect(void *instance, irda_param_t *parm,
--
1.7.4.4
^ permalink raw reply related
* Re: IRDA: Fix global type conflicts in net/irda/irsysctl.c
From: David Miller @ 2011-09-16 18:52 UTC (permalink / raw)
To: andi; +Cc: samuel, netdev
In-Reply-To: <20110916173251.GA25560@tassilo.jf.intel.com>
Please use "unsigned int" rather than plain "unsigned", and yes
that means you might have to fix up the other instances likewise.
^ permalink raw reply
* pull request: wireless-next 2011-09-16
From: John W. Linville @ 2011-09-16 18:31 UTC (permalink / raw)
To: davem; +Cc: linux-wireless, netdev
Dave,
This is a batch of updates intended for 3.2. They have been simmering
for a while, since I merged them just before the big kernel.org
shutdown. That includes time in wireless-testing and linux-next
(albeit the latter is diminished by the kernel.org outage). For now,
I am just trying to clear the backlog... :-)
This includes a sizable wl12xx pull and a bunch of iwlagn updates.
There are also a number of ath9k updates, some b43 updates, and a
handful of other bits.
Please let me know if there are problems!
Thanks,
John
---
The following changes since commit 986eaa904129fc888c6c3882f6405a0055110e51:
Merge branch 'master' of ../netdev-next/ (2011-09-16 02:58:54 -0400)
are available in the git repository at:
git://git.infradead.org/users/linville/wireless-next.git for-davem
Arik Nemtsov (17):
wl12xx: Revert "wl12xx: schedule TX packets according to FW occupancy"
wl12xx: Use a single fw for both STA and AP roles
wl12xx: use 1 spare block in all cases
wl12xx: handle dummy packet event also in ap mode
wl12xx: fix session counter
wl12xx: use dynamic hlids for AP-mode
wl12xx: re-enable block ack session support
wl12xx: AP-mode - set STA HT capabilities when adding a STA
wl12xx: AP-mode - configure STA HT rates on join
wl12xx: AP-mode - configure HT rate support to the FW
wl12xx: track freed packets in FW by AC
wl12xx: schedule TX packets according to FW packet occupancy
wl12xx: handle wrap-around overflow in released Tx blocks FW counter
wl12xx: enable AP advanced functionality
wl12xx: set the AP-started flag only after setting keys
wl12xx: AP-mode - prevent Tx to stale/invalid stations
wl12xx: fix tx_queue_count spurious increment
Axel Lin (1):
p54spi: add "spi:" prefix for stlc45xx modalias
Christian Lamparter (1):
p54: Use do_div for 64-bit division to fix 32-bit kernels
Daniel Halperin (1):
iwlagn: fix compile warnings when CONFIG_PM_SLEEP is not set
Eliad Peller (23):
wl12xx: temporarily disable advanced ap functions
wl12xx: remove rx filtering stuff
wl12xx: update fw status struct
wl12xx: update acx commands
wl12xx: update commands & events
wl12xx: enable/disable role on interface add/remove
wl12xx: add device role commands
wl12xx: update scan cmd api
wl12xx: update rx/tx
wl12xx: change max/default template size
wl12xx: use wl1271_acx_beacon_filter_opt for both sta and ap
wl12xx: add set_rate_mgmt_params acx
wl12xx: add system_hlid
wl12xx: add ROC/CROC commands
wl12xx: replace dummy_join with ROC/CROC commands
wl12xx: update BT coex configuration params
wl12xx: call wl12xx_cmd_set_peer_state() in AP mode
wl12xx: don't remove key if hlid was already deleted
wl12xx: add wl12xx_cmd_role_start_ibss()
wl12xx: support IBSS vif type
wl12xx: use ap_bcast_hlid for recorded keys
wl12xx: don't remove key if hlid was already deleted
wl12xx: don't wait for disconnection event
Emmanuel Grumbach (52):
iwlagn: use iwl_get_debug_level instead of iwl_debug_level
iwlagn: introduce iwl-shared.h
iwlagn: introduce struct iwl-shared - known by all layers
iwlagn: debug_level moves to struct iwl_shared
iwlagn: hw_params moves to iwl_shared
iwlagn: cmd_queue moves to iwl_shared
iwlagn: workqueue moves to iwl_shared
iwlagn: priv->status moves to iwl_shared
iwlagn: priv->lock moves to iwl_shared
iwlagn: priv->mutex moves to iwl_shared
iwlagn: modify the debug macro to be usable by all the layers
iwlagn: add IWL_DEBUG_FW_ERRORS
iwlagn: priv->sta_lock moves to iwl_shared
iwlagn: bus layer chooses its transport layer
iwlagn: add comments to iwl_bus / iwl_trans
iwlagn: transport handler can register debugfs entries
iwlagn: iwl_rx_queue moves to the iwl_trans_pcie
iwlagn: move iwl_suspend / iwl_resume to the transport layer
iwlagn: move ISR related data to transport layer
iwlagn: move the NIC error flow to the transport layer
iwlagn: move isr_statistics to transport layer
iwlagn: reclaim the packets in transport layer
iwlagn: move reclaim related functions
iwlagn: move scd_bc_tbls and scd_base_addr to iwl_trans_pcie
iwlagn: fix the check of IWLAGN_FIRST_AMPDU_QUEUE
iwlagn: move all iwl_is_XXX helpers to iwl-shared.h
iwlagn: move iwl_free_pages to iwl-shared.h
iwlagn: transport layer should receive iwl_trans
iwlagn: move hcmd_lock to transport layer
iwlagn: move dump_csr and dump_fh to transport layer
iwlagn: remove references to priv from the transport layer
iwlagn: remove unused parameters from hw_params
iwlagn: iwl-dev.h doesn't include iwl-fh.h any more
iwlagn: move Keep Warm to transport layer
iwlagn: add missing includes
iwlagn: all function iwl-io.c receive iwl_bus
iwlagn: iwl-pci doesn't include iwl-dev any more
iwlagn: iwl_tid_data moves to iwl-shared
iwlagn: remove dereferences of priv from transport
iwlagn: stop the device before freeing it
iwlagn: upper layer stores iwl_rxon_context in skb's CB
iwlagn: set tx_fifo for ampdu in transport layer
iwlagn: upper layer uses slabs to allocate tx cmds
iwlagn: move the mapping ac to queue / fifo to transport
iwlagn: allocate resources for TX BA session in transport
iwlagn: move the check_empty logic to the transport layer
iwlagn: move the disable agg logic to transport layer
iwlagn: cosmetics in iwl-trans.h
iwlagn: move wait_for_tx_queue_empty to transport layer
iwlagn: move check_stuck_queue to transport layer
iwlagn: move the stop / wake queue logic to transport layer
iwlagn: move tx queues to transport layer
Felix Fietkau (6):
ath9k: fix regression in sending aggregated packets
ath9k: use u8 for the tx key index
ath9k: clean up the aggregation tid queue
ath9k: move the sequence number from ath_frame_info to ath_buf
ath9k: move seqno allocation in the tx path to ath_tx_setup_buffer
ath9k: defer ath_tx_setup_buffer setup to the first tx attempt during aggr
Florian Fainelli (1):
ath9k: add missing AR9340 in ath_mac_bb_names
Gery Kahn (1):
wl12xx: fixes for hw_pg_ver and chip id reporting
Greg Dietsche (1):
iwlwifi: iwl-agn-rs.c: remove old comment
Joe Perches (2):
ath: Make ath_dbg void not int
ath: Make ath_printk void not int and remove unused struct ath_common *
Johannes Berg (1):
iwlagn: handle GO powersave
John W. Linville (4):
Merge branch 'for-linville' of git://git.kernel.org/.../luca/wl12xx
mac80211: refactor skb copy to failq in mesh_path_move_to_queue
wl12xx/sdio_test.c: fix build breakage from WL127X_FW_NAME change
Merge branch 'master' of git://git.infradead.org/users/linville/wireless-next into for-davem
Larry Finger (3):
b43: Relax requirement for descriptors to be in the DMA zone
ath9k: Fix a smatch warnings
b43: Fix swatch warning
Mohammed Shafi Shajakhan (2):
ath9k: use appropriate debug mask
ath9k: minor cleanup in ani
Peter Huewe (1):
net/mac80211/debugfs: Convert to kstrou8_from_user
Rafał Miłecki (2):
b43: use 8K buffers for 64-bit DMA to workaround hardware bug
b43: make HT-PHY support experimental
Rajkumar Manoharan (3):
ath9k_hw: Set default slottime as 9us
ath9k: Fix eifs/usec timeout for AR9287 v1.3+
ath9k: Add debugfs support for mac/baseband samples
Shahar Levi (1):
wl12xx: Add support to RX packets payload alignment
Stanislaw Gruszka (1):
cfg80211: document wiphy->registered
Wey-Yi Guy (7):
iwlagn: Rename iwlcore prefix
iwlagn: remove out-dated comments
iwlagn: enable 11n aggregation without checking traffic load
iwlagn: support small form factor SKU of 6205
iwlagn: more comments for bt channel inhibition
iwlagn: add comments to module parameters
iwlagn: adding special "D" SKU for 2000 series
drivers/net/wireless/ath/ath.h | 48 +-
drivers/net/wireless/ath/ath9k/ani.c | 2 +-
drivers/net/wireless/ath/ath9k/ani.h | 5 +-
drivers/net/wireless/ath/ath9k/ar9002_mac.c | 2 +-
drivers/net/wireless/ath/ath9k/ar9003_eeprom.c | 2 +-
drivers/net/wireless/ath/ath9k/ar9003_mac.c | 2 +-
drivers/net/wireless/ath/ath9k/ath9k.h | 7 +-
drivers/net/wireless/ath/ath9k/debug.c | 312 ++++-
drivers/net/wireless/ath/ath9k/debug.h | 47 +
drivers/net/wireless/ath/ath9k/htc_drv_main.c | 1 +
drivers/net/wireless/ath/ath9k/hw.c | 13 +-
drivers/net/wireless/ath/ath9k/hw.h | 2 +-
drivers/net/wireless/ath/ath9k/init.c | 1 +
drivers/net/wireless/ath/ath9k/mac.h | 3 +-
drivers/net/wireless/ath/ath9k/main.c | 2 +
drivers/net/wireless/ath/ath9k/recv.c | 24 +-
drivers/net/wireless/ath/ath9k/reg.h | 2 +
drivers/net/wireless/ath/ath9k/xmit.c | 234 ++--
drivers/net/wireless/ath/main.c | 8 +-
drivers/net/wireless/b43/Kconfig | 6 +-
drivers/net/wireless/b43/dma.c | 31 +-
drivers/net/wireless/b43/dma.h | 3 +-
drivers/net/wireless/b43/main.c | 5 +-
drivers/net/wireless/iwlwifi/iwl-1000.c | 42 +-
drivers/net/wireless/iwlwifi/iwl-2000.c | 51 +-
drivers/net/wireless/iwlwifi/iwl-5000.c | 72 +-
drivers/net/wireless/iwlwifi/iwl-6000.c | 60 +-
drivers/net/wireless/iwlwifi/iwl-agn-calib.c | 43 +-
drivers/net/wireless/iwlwifi/iwl-agn-eeprom.c | 6 +-
drivers/net/wireless/iwlwifi/iwl-agn-hw.h | 13 -
drivers/net/wireless/iwlwifi/iwl-agn-lib.c | 676 +--------
drivers/net/wireless/iwlwifi/iwl-agn-rs.c | 93 +-
drivers/net/wireless/iwlwifi/iwl-agn-rxon.c | 65 +-
drivers/net/wireless/iwlwifi/iwl-agn-sta.c | 84 +-
drivers/net/wireless/iwlwifi/iwl-agn-tt.c | 68 +-
drivers/net/wireless/iwlwifi/iwl-agn-tx.c | 913 ++++++------
drivers/net/wireless/iwlwifi/iwl-agn-ucode.c | 52 +-
drivers/net/wireless/iwlwifi/iwl-agn.c | 938 ++++--------
drivers/net/wireless/iwlwifi/iwl-agn.h | 63 +-
drivers/net/wireless/iwlwifi/iwl-bus.h | 34 +-
drivers/net/wireless/iwlwifi/iwl-commands.h | 6 +-
drivers/net/wireless/iwlwifi/iwl-core.c | 284 ++---
drivers/net/wireless/iwlwifi/iwl-core.h | 118 +--
drivers/net/wireless/iwlwifi/iwl-debug.h | 40 +-
drivers/net/wireless/iwlwifi/iwl-debugfs.c | 412 +-----
drivers/net/wireless/iwlwifi/iwl-dev.h | 329 +----
drivers/net/wireless/iwlwifi/iwl-devtrace.h | 2 +
drivers/net/wireless/iwlwifi/iwl-eeprom.c | 62 +-
drivers/net/wireless/iwlwifi/iwl-eeprom.h | 1 -
drivers/net/wireless/iwlwifi/iwl-fh.h | 20 +-
drivers/net/wireless/iwlwifi/iwl-helpers.h | 91 +--
drivers/net/wireless/iwlwifi/iwl-io.c | 192 ++--
drivers/net/wireless/iwlwifi/iwl-io.h | 61 +-
drivers/net/wireless/iwlwifi/iwl-led.c | 11 +-
drivers/net/wireless/iwlwifi/iwl-pci.c | 43 +-
drivers/net/wireless/iwlwifi/iwl-pci.h | 116 ++
drivers/net/wireless/iwlwifi/iwl-power.c | 19 +-
drivers/net/wireless/iwlwifi/iwl-prph.h | 4 +-
drivers/net/wireless/iwlwifi/iwl-rx.c | 42 +-
drivers/net/wireless/iwlwifi/iwl-scan.c | 97 +-
drivers/net/wireless/iwlwifi/iwl-shared.h | 430 ++++++
drivers/net/wireless/iwlwifi/iwl-sta.c | 106 +-
drivers/net/wireless/iwlwifi/iwl-sta.h | 4 +-
drivers/net/wireless/iwlwifi/iwl-sv-open.c | 21 +-
drivers/net/wireless/iwlwifi/iwl-trans-int-pcie.h | 314 ++++-
drivers/net/wireless/iwlwifi/iwl-trans-rx-pcie.c | 862 +++++++++---
drivers/net/wireless/iwlwifi/iwl-trans-tx-pcie.c | 506 +++++--
drivers/net/wireless/iwlwifi/iwl-trans.c | 1615 ++++++++++++++++-----
drivers/net/wireless/iwlwifi/iwl-trans.h | 216 ++-
drivers/net/wireless/p54/p54spi.c | 2 +-
drivers/net/wireless/p54/txrx.c | 12 +-
drivers/net/wireless/wl12xx/acx.c | 322 ++---
drivers/net/wireless/wl12xx/acx.h | 394 ++----
drivers/net/wireless/wl12xx/boot.c | 43 +-
drivers/net/wireless/wl12xx/boot.h | 3 +-
drivers/net/wireless/wl12xx/cmd.c | 793 ++++++++---
drivers/net/wireless/wl12xx/cmd.h | 329 +++--
drivers/net/wireless/wl12xx/conf.h | 352 ++---
drivers/net/wireless/wl12xx/debugfs.c | 17 +-
drivers/net/wireless/wl12xx/event.c | 6 +-
drivers/net/wireless/wl12xx/event.h | 80 +-
drivers/net/wireless/wl12xx/init.c | 91 +-
drivers/net/wireless/wl12xx/io.h | 1 -
drivers/net/wireless/wl12xx/main.c | 961 ++++++++-----
drivers/net/wireless/wl12xx/ps.c | 4 +-
drivers/net/wireless/wl12xx/reg.h | 75 -
drivers/net/wireless/wl12xx/rx.c | 60 +-
drivers/net/wireless/wl12xx/rx.h | 18 +-
drivers/net/wireless/wl12xx/scan.c | 38 +-
drivers/net/wireless/wl12xx/scan.h | 25 +-
drivers/net/wireless/wl12xx/sdio.c | 4 +-
drivers/net/wireless/wl12xx/sdio_test.c | 2 +-
drivers/net/wireless/wl12xx/spi.c | 4 +-
drivers/net/wireless/wl12xx/tx.c | 136 ++-
drivers/net/wireless/wl12xx/tx.h | 16 +-
drivers/net/wireless/wl12xx/wl12xx.h | 153 +-
drivers/net/wireless/wl12xx/wl12xx_80211.h | 25 -
include/net/cfg80211.h | 1 +
net/mac80211/debugfs.c | 14 +-
net/mac80211/mesh_pathtbl.c | 8 +-
100 files changed, 7670 insertions(+), 6378 deletions(-)
create mode 100644 drivers/net/wireless/iwlwifi/iwl-pci.h
create mode 100644 drivers/net/wireless/iwlwifi/iwl-shared.h
Omnibus patch is available here:
http://bombadil.infradead.org/~linville/wireless-next-2011-09-16.patch.gz
--
John W. Linville Someday the world will need a hero, and you
linville@tuxdriver.com might be all we have. Be ready.
^ permalink raw reply
* [PATCH] can: ti_hecc: include linux/io.h
From: Daniel Mack @ 2011-09-16 17:57 UTC (permalink / raw)
To: linux-kernel; +Cc: Daniel Mack, Wolfgang Grandegger, netdev
This fixes a build breakage for OMAP3 boards.
Signed-off-by: Daniel Mack <zonque@gmail.com>
Cc: Wolfgang Grandegger <wg@grandegger.com>
Cc: netdev@vger.kernel.org
---
drivers/net/can/ti_hecc.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/net/can/ti_hecc.c b/drivers/net/can/ti_hecc.c
index a812492..2adc294 100644
--- a/drivers/net/can/ti_hecc.c
+++ b/drivers/net/can/ti_hecc.c
@@ -46,6 +46,7 @@
#include <linux/skbuff.h>
#include <linux/platform_device.h>
#include <linux/clk.h>
+#include <linux/io.h>
#include <linux/can/dev.h>
#include <linux/can/error.h>
--
1.7.6
^ permalink raw reply related
* IRDA: Fix global type conflicts in net/irda/irsysctl.c
From: Andi Kleen @ 2011-09-16 17:32 UTC (permalink / raw)
To: samuel, davem, netdev
The externs here didn't agree with the declarations in qos.c.
Better would be probably to move this into a header, but since it's
common practice to have naked externs with sysctls I left it for now.
Cc: samuel@sortiz.org
Signed-off-by: Andi Kleen <ak@linux.intel.com>
diff --git a/net/irda/irsysctl.c b/net/irda/irsysctl.c
index d0b70da..be22ad2 100644
--- a/net/irda/irsysctl.c
+++ b/net/irda/irsysctl.c
@@ -40,9 +40,9 @@ extern int sysctl_slot_timeout;
extern int sysctl_fast_poll_increase;
extern char sysctl_devname[];
extern int sysctl_max_baud_rate;
-extern int sysctl_min_tx_turn_time;
-extern int sysctl_max_tx_data_size;
-extern int sysctl_max_tx_window;
+extern unsigned sysctl_min_tx_turn_time;
+extern unsigned sysctl_max_tx_data_size;
+extern unsigned sysctl_max_tx_window;
extern int sysctl_max_noreply_time;
extern int sysctl_warn_noreply_time;
extern int sysctl_lap_keepalive_time;
--
ak@linux.intel.com -- Speaking for myself only
^ permalink raw reply related
* iproute2 repository (temp)
From: Stephen Hemminger @ 2011-09-16 17:30 UTC (permalink / raw)
To: netdev
Since there are a number of small patches pending, and a few more waiting.
I put the current iproute2 repository over on github until kernel.org comes back.
git clone git://github.com/shemminger/iproute2.git
^ permalink raw reply
* Re: re add support for bcm5750
From: Matt Carlson @ 2011-09-16 16:28 UTC (permalink / raw)
To: Francesco Piccinno
Cc: Florian Mickler, Matthew Carlson, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, Benjamin Li, Michael Chan,
davem@davemloft.net
In-Reply-To: <CAA7bCn4NTSppmAph9pxykpEfYT_tYoBFV8zReaKFgJqcu6=t7Q@mail.gmail.com>
On Fri, Sep 16, 2011 at 06:39:30AM -0700, Francesco Piccinno wrote:
> I have contacted Broadcom asking for support and apparently there is
> no way to fix the problem. Now I have a couple of questions: the use
> of tg3 driver without a firmware expose the NIC to some risks or not?
> And is there any chance to have the PCI IDs added back to tg3 module?
> I do not want to modify and recompile the module at every version
> bump.
>
> Thanks for the support :)
That's the plan. It's on my TODO list to add support back in.
> --
> Best regards,
> Francesco Piccinno
>
>
>
> On Wed, Sep 7, 2011 at 8:36 PM, Florian Mickler <florian@mickler.org> wrote:
> > On Tue, 6 Sep 2011 18:25:15 -0700
> > "Matt Carlson" <mcarlson@broadcom.com> wrote:
> >
> >> On Tue, Sep 06, 2011 at 08:03:43AM -0700, Florian Mickler wrote:
> >> > Hi,
> >> >
> >> > in https://bugzilla.kernel.org/show_bug.cgi?id=42132 Francesco wrote:
> >> >
> >> > > I have a notebook (HP TC4400) which has a BCM5750 ethernet card inside. The
> >> > > ouput of lspci is:
> >> > >
> >> > > 08:00.0 Ethernet controller [0200]: Broadcom Corporation NetXtreme BCM5750M
> >> > > Gigabit Ethernet [14e4:167c]
> >> > >
> >> > > Commit 67b284d476bcb3d100e946da23d6cf9acfd0465c removed the support for this
> >> > > device. I wish to have the support for this network card back again. Thanks!
> >>
> >> Hi Florian. ??Are you experiencing the same problem? ??We found that
> >> Francesco's problem was that the firmware of his device was missing. ??Do
> >> you see :
> >>
> >> eth0: No firmware running
> >>
> >> messages?
> >>
> >
> > Hi Matt!
> > No, I was just browsing the regression list and found this entry but
> > couldn't associate any action with it.
> >
> > This clears that up, thanks for the information and I will close this
> > bug.
> >
> > Regards,
> > Flo
> >
>
^ permalink raw reply
* RE: Very confused about broute DROP
From: Greg Scott @ 2011-09-16 14:55 UTC (permalink / raw)
To: Christian Benvenuti (benve), netdev; +Cc: Graham Parenteau
In-Reply-To: <184D23435BECB444AB6B9D4630C8EC8302854957@XMB-RCD-303.cisco.com>
Definitely counter-intuitive in my head. Three little ebtables rules -
ACCEPT anything IPv4 - which includes ARPs - for a couple of IP
Addresses and then DROP everything else for all protocols. (Which
really means bridge for those IPv4 Addresses and route for everything
else.)
I don't see how a rule specific to ARPs matters here. ARP is an IPv4
protocol and should be implied in the rules I set up - right? Why a
rule specific to ARPs when it's already part of IPv4?
This just hit me - layer 2 is stateless. I have ACCEPT rules for frames
bound for **destination** IPv4 IP Addresses. I wonder if I need similar
rules for these same IP Addresses as sources? But that still doesn't
make sense - that rule to DROP everything else covers all sources and
all destinations. When I put in that ebtables DROP rule, the box turns
into a black hole instead of a router.
Maybe one day the lightbulb will light up in my head, but right now I
still don't get it.
- Greg
-----Original Message-----
From: Christian Benvenuti (benve) [mailto:benve@cisco.com]
Sent: Thursday, September 15, 2011 11:23 PM
To: Greg Scott; netdev@vger.kernel.org
Cc: Graham Parenteau
Subject: RE: Very confused about broute DROP
What I meant is that your host needs to be able to route
(which means ... to process) its own ARP traffic, ... IPv4
does not work without ARP, right?
This means you need to add one more DROP rule for the ARP
traffic that is addressed to the MAC of the host interfaces
(nothing to do with proxy ARP).
/Chris
^ permalink raw reply
* Re: re add support for bcm5750
From: Francesco Piccinno @ 2011-09-16 13:39 UTC (permalink / raw)
To: Florian Mickler
Cc: Matt Carlson, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, Benjamin Li, Michael Chan,
davem@davemloft.net
In-Reply-To: <20110907203646.2a7b7833@schatten.dmk.lab>
I have contacted Broadcom asking for support and apparently there is
no way to fix the problem. Now I have a couple of questions: the use
of tg3 driver without a firmware expose the NIC to some risks or not?
And is there any chance to have the PCI IDs added back to tg3 module?
I do not want to modify and recompile the module at every version
bump.
Thanks for the support :)
--
Best regards,
Francesco Piccinno
On Wed, Sep 7, 2011 at 8:36 PM, Florian Mickler <florian@mickler.org> wrote:
> On Tue, 6 Sep 2011 18:25:15 -0700
> "Matt Carlson" <mcarlson@broadcom.com> wrote:
>
>> On Tue, Sep 06, 2011 at 08:03:43AM -0700, Florian Mickler wrote:
>> > Hi,
>> >
>> > in https://bugzilla.kernel.org/show_bug.cgi?id=42132 Francesco wrote:
>> >
>> > > I have a notebook (HP TC4400) which has a BCM5750 ethernet card inside. The
>> > > ouput of lspci is:
>> > >
>> > > 08:00.0 Ethernet controller [0200]: Broadcom Corporation NetXtreme BCM5750M
>> > > Gigabit Ethernet [14e4:167c]
>> > >
>> > > Commit 67b284d476bcb3d100e946da23d6cf9acfd0465c removed the support for this
>> > > device. I wish to have the support for this network card back again. Thanks!
>>
>> Hi Florian. Are you experiencing the same problem? We found that
>> Francesco's problem was that the firmware of his device was missing. Do
>> you see :
>>
>> eth0: No firmware running
>>
>> messages?
>>
>
> Hi Matt!
> No, I was just browsing the regression list and found this entry but
> couldn't associate any action with it.
>
> This clears that up, thanks for the information and I will close this
> bug.
>
> Regards,
> Flo
>
^ permalink raw reply
* Re: [PATCH] ixgbe: get pauseparam autoneg
From: Jeff Kirsher @ 2011-09-16 8:19 UTC (permalink / raw)
To: Esa-Pekka Pyokkimies
Cc: netdev@vger.kernel.org, mika.lansirinne@stonesoft.com
In-Reply-To: <op.v1v077z76ywr33@esapekka-pc.rad1>
On Thu, Sep 15, 2011 at 23:20, Esa-Pekka Pyokkimies
<esa-pekka.pyokkimies@stonesoft.com> wrote:
> There is a problem in the ixgbe driver with the reporting of the flow
> control parameters. The autoneg parameter is shown to be of if
> *either* it really is off, or current modes for both tx and rx are off.
>
> The problem is seen when the parameters are read or set when the link
> is down. In this case, the driver sees that tx and rx are currently off
> and therefore autoneg parameter is incorrectly reported to be off too.
> Also, the ethtool binary can not set the autoneg off since it sees that
> it already is. When a link later comes up, the autonegotiation is
> carried out normally and the driver later on reports the autoneg
> parameter to be on (as it is) and then it can also be changed with
> ethtool.
>
> The patch is made against v3.0 kernel, but the problem seems to be there
> since v2.6.30-rc1.
>
> Reviewer comments: What we are trying to do is to disable flow control
> while the cable is disconnected. Since ixgbe defaults to full flow
> control, we call ethtool -A autoneg off rx off tx off while the cable
> is disconnected. This doesn't work, because the driver sets
> hw->fc.current_mode = ixgbe_fc_none if the cable is unplugged.
> ixgbe_get_pauseparam() then reports to ethtool that nothing needs to be
> done. The code fixes this, but it might have some unknown consequences.
>
> Signed-off-by: Mika Lansirinne <mika.lansirinne@stonesoft.com>
> Reviewed-by: Esa-Pekka Pyokkimies <esa-pekka.pyokkimies@stonesoft.com>
> Cc: Tantilov, Emil S <emil.s.tantilov@intel.com>
> ---
> diff --git a/drivers/net/ixgbe/ixgbe_ethtool.c
> b/drivers/net/ixgbe/ixgbe_ethtool.c
> index 82d4244..db27c24 100644
> --- a/drivers/net/ixgbe/ixgbe_ethtool.c
> +++ b/drivers/net/ixgbe/ixgbe_ethtool.c
> @@ -368,13 +368,7 @@ static void ixgbe_get_pauseparam(struct net_device
> *netdev,
> struct ixgbe_adapter *adapter = netdev_priv(netdev);
> struct ixgbe_hw *hw = &adapter->hw;
>
> - /*
> - * Flow Control Autoneg isn't on if
> - * - we didn't ask for it OR
> - * - it failed, we know this by tx & rx being off
> - */
> - if (hw->fc.disable_fc_autoneg ||
> - (hw->fc.current_mode == ixgbe_fc_none))
> + if (hw->fc.disable_fc_autoneg)
> pause->autoneg = 0;
> else
> pause->autoneg = 1;
> --
Thanks! I have applied this patch to my queue.
--
Cheers,
Jeff
^ permalink raw reply
* [PATCH] ixgbe: get pauseparam autoneg
From: Esa-Pekka Pyokkimies @ 2011-09-16 6:20 UTC (permalink / raw)
To: netdev@vger.kernel.org; +Cc: mika.lansirinne@stonesoft.com
In-Reply-To: <op.v1ozj4zk6ywr33@esapekka-pc.rad1>
There is a problem in the ixgbe driver with the reporting of the flow
control parameters. The autoneg parameter is shown to be of if
*either* it really is off, or current modes for both tx and rx are off.
The problem is seen when the parameters are read or set when the link
is down. In this case, the driver sees that tx and rx are currently off
and therefore autoneg parameter is incorrectly reported to be off too.
Also, the ethtool binary can not set the autoneg off since it sees that
it already is. When a link later comes up, the autonegotiation is
carried out normally and the driver later on reports the autoneg
parameter to be on (as it is) and then it can also be changed with
ethtool.
The patch is made against v3.0 kernel, but the problem seems to be there
since v2.6.30-rc1.
Reviewer comments: What we are trying to do is to disable flow control
while the cable is disconnected. Since ixgbe defaults to full flow
control, we call ethtool -A autoneg off rx off tx off while the cable
is disconnected. This doesn't work, because the driver sets
hw->fc.current_mode = ixgbe_fc_none if the cable is unplugged.
ixgbe_get_pauseparam() then reports to ethtool that nothing needs to be
done. The code fixes this, but it might have some unknown consequences.
Signed-off-by: Mika Lansirinne <mika.lansirinne@stonesoft.com>
Reviewed-by: Esa-Pekka Pyokkimies <esa-pekka.pyokkimies@stonesoft.com>
Cc: Tantilov, Emil S <emil.s.tantilov@intel.com>
---
diff --git a/drivers/net/ixgbe/ixgbe_ethtool.c
b/drivers/net/ixgbe/ixgbe_ethtool.c
index 82d4244..db27c24 100644
--- a/drivers/net/ixgbe/ixgbe_ethtool.c
+++ b/drivers/net/ixgbe/ixgbe_ethtool.c
@@ -368,13 +368,7 @@ static void ixgbe_get_pauseparam(struct net_device
*netdev,
struct ixgbe_adapter *adapter = netdev_priv(netdev);
struct ixgbe_hw *hw = &adapter->hw;
- /*
- * Flow Control Autoneg isn't on if
- * - we didn't ask for it OR
- * - it failed, we know this by tx & rx being off
- */
- if (hw->fc.disable_fc_autoneg ||
- (hw->fc.current_mode == ixgbe_fc_none))
+ if (hw->fc.disable_fc_autoneg)
pause->autoneg = 0;
else
pause->autoneg = 1;
^ permalink raw reply related
* LAN9514 eeprom problems
From: John Crosbie @ 2011-09-16 5:20 UTC (permalink / raw)
To: steve.glendinning, netdev
Steve,
I am working on an ARM7 board that contains a LAN9514 with 93LC66A
eeprom. The Linux kernel version is 2.6.32. I am seeing problems
programming the eeprom with ethtool.
If I read then it works as expected:
ethtool -e usb0
will give 512 ff's
Then I issue the command:
ethtool -E usb0 magic 0x9500 offset 0 length 1 value 0xdd
and get:
[ 72.779431] usb0: eeprom: EWEN a0000000
[ 72.784211] usb0: eeprom ready
[ 72.818265] usb0: EEPROM read operation timeout val=30000400
Cannot set EEPROM data: Input/output error
The 1st two kernel messages have been added by me along with printing the value.
I can see with a o'scope that the signalling at the chip looks good
but it appears that the 9514 returns timeout before the 93LC66 has
finished its writing busy cycle.
After doing this, if I read again then I get a timeout again:
root@2065:~# ethtool -e usb0
[ 95.889447] usb0: EEPROM read operation timeout val=00000400
Cannot get EEPROM data: Input/output error
I have to reboot to get read to work again.
My problem is that I cannot find any register level specs for the
9514. I have the data sheet and the software manual. The datasheet
describes the hardware pins and the software manual describes the
device drivers but there is a big document missing inbetween these
two.
I have seen that the driver provided on the SMSC website performs many
retries that the kernel.org driver does not when reading and writing
registers. Are these really required. Any suggestions/pointer would
be appreciated.
Regards,
John Crosbie
Excelfore
^ permalink raw reply
* [net-next 11/11] ixgbe: Correctly name and handle MSI-X other interrupt
From: Jeff Kirsher @ 2011-09-16 4:42 UTC (permalink / raw)
To: davem; +Cc: Alexander Duyck, netdev, gospo, Jeff Kirsher
In-Reply-To: <1316148173-11209-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Alexander Duyck <alexander.h.duyck@intel.com>
It was possible to inadvertently add additional interrupt causes to the
MSI-X other interrupt. This occurred when things such as RX buffer overrun
events were being triggered at the same time as an event such as a Flow
Director table reinit request. In order to avoid this we should be
explicitly programming only the interrupts that we want enabled. In
addition I am renaming the ixgbe_msix_lsc function and interrupt to drop
any implied meaning of this being a link status only interrupt.
Unfortunately the patch is a bit ugly due to the fact that ixgbe_irq_enable
needed to be moved up before ixgbe_msix_other in order to have things
defined in the correct order.
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/ixgbe/ixgbe.h | 1 -
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 191 +++++++++++++------------
2 files changed, 97 insertions(+), 95 deletions(-)
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe.h b/drivers/net/ethernet/intel/ixgbe/ixgbe.h
index 3f5a744..bfdd42b 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe.h
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe.h
@@ -491,7 +491,6 @@ struct ixgbe_adapter {
int node;
u32 led_reg;
u32 interrupt_event;
- char lsc_int_name[IFNAMSIZ + 9];
/* SR-IOV */
DECLARE_BITMAP(active_vfs, IXGBE_MAX_VF_FUNCTIONS);
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 0ee7d09..6026ab0 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -1828,7 +1828,98 @@ static void ixgbe_check_lsc(struct ixgbe_adapter *adapter)
}
}
-static irqreturn_t ixgbe_msix_lsc(int irq, void *data)
+static inline void ixgbe_irq_enable_queues(struct ixgbe_adapter *adapter,
+ u64 qmask)
+{
+ u32 mask;
+ struct ixgbe_hw *hw = &adapter->hw;
+
+ switch (hw->mac.type) {
+ case ixgbe_mac_82598EB:
+ mask = (IXGBE_EIMS_RTX_QUEUE & qmask);
+ IXGBE_WRITE_REG(hw, IXGBE_EIMS, mask);
+ break;
+ case ixgbe_mac_82599EB:
+ case ixgbe_mac_X540:
+ mask = (qmask & 0xFFFFFFFF);
+ if (mask)
+ IXGBE_WRITE_REG(hw, IXGBE_EIMS_EX(0), mask);
+ mask = (qmask >> 32);
+ if (mask)
+ IXGBE_WRITE_REG(hw, IXGBE_EIMS_EX(1), mask);
+ break;
+ default:
+ break;
+ }
+ /* skip the flush */
+}
+
+static inline void ixgbe_irq_disable_queues(struct ixgbe_adapter *adapter,
+ u64 qmask)
+{
+ u32 mask;
+ struct ixgbe_hw *hw = &adapter->hw;
+
+ switch (hw->mac.type) {
+ case ixgbe_mac_82598EB:
+ mask = (IXGBE_EIMS_RTX_QUEUE & qmask);
+ IXGBE_WRITE_REG(hw, IXGBE_EIMC, mask);
+ break;
+ case ixgbe_mac_82599EB:
+ case ixgbe_mac_X540:
+ mask = (qmask & 0xFFFFFFFF);
+ if (mask)
+ IXGBE_WRITE_REG(hw, IXGBE_EIMC_EX(0), mask);
+ mask = (qmask >> 32);
+ if (mask)
+ IXGBE_WRITE_REG(hw, IXGBE_EIMC_EX(1), mask);
+ break;
+ default:
+ break;
+ }
+ /* skip the flush */
+}
+
+/**
+ * ixgbe_irq_enable - Enable default interrupt generation settings
+ * @adapter: board private structure
+ **/
+static inline void ixgbe_irq_enable(struct ixgbe_adapter *adapter, bool queues,
+ bool flush)
+{
+ u32 mask = (IXGBE_EIMS_ENABLE_MASK & ~IXGBE_EIMS_RTX_QUEUE);
+
+ /* don't reenable LSC while waiting for link */
+ if (adapter->flags & IXGBE_FLAG_NEED_LINK_UPDATE)
+ mask &= ~IXGBE_EIMS_LSC;
+
+ if (adapter->flags2 & IXGBE_FLAG2_TEMP_SENSOR_CAPABLE)
+ mask |= IXGBE_EIMS_GPI_SDP0;
+ if (adapter->flags & IXGBE_FLAG_FAN_FAIL_CAPABLE)
+ mask |= IXGBE_EIMS_GPI_SDP1;
+ switch (adapter->hw.mac.type) {
+ case ixgbe_mac_82599EB:
+ case ixgbe_mac_X540:
+ mask |= IXGBE_EIMS_ECC;
+ mask |= IXGBE_EIMS_GPI_SDP1;
+ mask |= IXGBE_EIMS_GPI_SDP2;
+ mask |= IXGBE_EIMS_MAILBOX;
+ break;
+ default:
+ break;
+ }
+ if ((adapter->flags & IXGBE_FLAG_FDIR_HASH_CAPABLE) &&
+ !(adapter->flags2 & IXGBE_FLAG2_FDIR_REQUIRES_REINIT))
+ mask |= IXGBE_EIMS_FLOW_DIR;
+
+ IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMS, mask);
+ if (queues)
+ ixgbe_irq_enable_queues(adapter, ~0);
+ if (flush)
+ IXGBE_WRITE_FLUSH(&adapter->hw);
+}
+
+static irqreturn_t ixgbe_msix_other(int irq, void *data)
{
struct ixgbe_adapter *adapter = data;
struct ixgbe_hw *hw = &adapter->hw;
@@ -1852,6 +1943,9 @@ static irqreturn_t ixgbe_msix_lsc(int irq, void *data)
switch (hw->mac.type) {
case ixgbe_mac_82599EB:
case ixgbe_mac_X540:
+ if (eicr & IXGBE_EICR_ECC)
+ e_info(link, "Received unrecoverable ECC Err, please "
+ "reboot\n");
/* Handle Flow Director Full threshold interrupt */
if (eicr & IXGBE_EICR_FLOW_DIR) {
int reinit_count = 0;
@@ -1865,7 +1959,6 @@ static irqreturn_t ixgbe_msix_lsc(int irq, void *data)
if (reinit_count) {
/* no more flow director interrupts until after init */
IXGBE_WRITE_REG(hw, IXGBE_EIMC, IXGBE_EIMC_FLOW_DIR);
- eicr &= ~IXGBE_EICR_FLOW_DIR;
adapter->flags2 |= IXGBE_FLAG2_FDIR_REQUIRES_REINIT;
ixgbe_service_event_schedule(adapter);
}
@@ -1888,64 +1981,11 @@ static irqreturn_t ixgbe_msix_lsc(int irq, void *data)
/* re-enable the original interrupt state, no lsc, no queues */
if (!test_bit(__IXGBE_DOWN, &adapter->state))
- IXGBE_WRITE_REG(hw, IXGBE_EIMS, eicr &
- ~(IXGBE_EIMS_LSC | IXGBE_EIMS_RTX_QUEUE));
+ ixgbe_irq_enable(adapter, false, false);
return IRQ_HANDLED;
}
-static inline void ixgbe_irq_enable_queues(struct ixgbe_adapter *adapter,
- u64 qmask)
-{
- u32 mask;
- struct ixgbe_hw *hw = &adapter->hw;
-
- switch (hw->mac.type) {
- case ixgbe_mac_82598EB:
- mask = (IXGBE_EIMS_RTX_QUEUE & qmask);
- IXGBE_WRITE_REG(hw, IXGBE_EIMS, mask);
- break;
- case ixgbe_mac_82599EB:
- case ixgbe_mac_X540:
- mask = (qmask & 0xFFFFFFFF);
- if (mask)
- IXGBE_WRITE_REG(hw, IXGBE_EIMS_EX(0), mask);
- mask = (qmask >> 32);
- if (mask)
- IXGBE_WRITE_REG(hw, IXGBE_EIMS_EX(1), mask);
- break;
- default:
- break;
- }
- /* skip the flush */
-}
-
-static inline void ixgbe_irq_disable_queues(struct ixgbe_adapter *adapter,
- u64 qmask)
-{
- u32 mask;
- struct ixgbe_hw *hw = &adapter->hw;
-
- switch (hw->mac.type) {
- case ixgbe_mac_82598EB:
- mask = (IXGBE_EIMS_RTX_QUEUE & qmask);
- IXGBE_WRITE_REG(hw, IXGBE_EIMC, mask);
- break;
- case ixgbe_mac_82599EB:
- case ixgbe_mac_X540:
- mask = (qmask & 0xFFFFFFFF);
- if (mask)
- IXGBE_WRITE_REG(hw, IXGBE_EIMC_EX(0), mask);
- mask = (qmask >> 32);
- if (mask)
- IXGBE_WRITE_REG(hw, IXGBE_EIMC_EX(1), mask);
- break;
- default:
- break;
- }
- /* skip the flush */
-}
-
static irqreturn_t ixgbe_msix_clean_rings(int irq, void *data)
{
struct ixgbe_q_vector *q_vector = data;
@@ -2077,9 +2117,8 @@ static int ixgbe_request_msix_irqs(struct ixgbe_adapter *adapter)
}
}
- sprintf(adapter->lsc_int_name, "%s:lsc", netdev->name);
err = request_irq(adapter->msix_entries[vector].vector,
- ixgbe_msix_lsc, 0, adapter->lsc_int_name, adapter);
+ ixgbe_msix_other, 0, netdev->name, adapter);
if (err) {
e_err(probe, "request_irq for msix_lsc failed: %d\n", err);
goto free_queue_irqs;
@@ -2103,42 +2142,6 @@ free_queue_irqs:
}
/**
- * ixgbe_irq_enable - Enable default interrupt generation settings
- * @adapter: board private structure
- **/
-static inline void ixgbe_irq_enable(struct ixgbe_adapter *adapter, bool queues,
- bool flush)
-{
- u32 mask;
-
- mask = (IXGBE_EIMS_ENABLE_MASK & ~IXGBE_EIMS_RTX_QUEUE);
- if (adapter->flags2 & IXGBE_FLAG2_TEMP_SENSOR_CAPABLE)
- mask |= IXGBE_EIMS_GPI_SDP0;
- if (adapter->flags & IXGBE_FLAG_FAN_FAIL_CAPABLE)
- mask |= IXGBE_EIMS_GPI_SDP1;
- switch (adapter->hw.mac.type) {
- case ixgbe_mac_82599EB:
- case ixgbe_mac_X540:
- mask |= IXGBE_EIMS_ECC;
- mask |= IXGBE_EIMS_GPI_SDP1;
- mask |= IXGBE_EIMS_GPI_SDP2;
- if (adapter->num_vfs)
- mask |= IXGBE_EIMS_MAILBOX;
- break;
- default:
- break;
- }
- if (adapter->flags & IXGBE_FLAG_FDIR_HASH_CAPABLE)
- mask |= IXGBE_EIMS_FLOW_DIR;
-
- IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMS, mask);
- if (queues)
- ixgbe_irq_enable_queues(adapter, ~0);
- if (flush)
- IXGBE_WRITE_FLUSH(&adapter->hw);
-}
-
-/**
* ixgbe_intr - legacy mode Interrupt Handler
* @irq: interrupt number
* @data: pointer to a network interface device structure
--
1.7.6
^ permalink raw reply related
* [net-next 10/11] ixgbe: cleanup configuration of EITRSEL and VF reset path
From: Jeff Kirsher @ 2011-09-16 4:42 UTC (permalink / raw)
To: davem; +Cc: Alexander Duyck, netdev, gospo, Jeff Kirsher
In-Reply-To: <1316148173-11209-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Alexander Duyck <alexander.h.duyck@intel.com>
This change is meant to cleanup some of the code related to SR-IOV and the
interrupt registers. Specifically I am moving the EITRSEL configuration
into the MSI-X configuration section instead of enablement. Also I am
fixing the VF shutdown path since it had operations in the incorrect order.
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 25 +++++++++++++------------
1 files changed, 13 insertions(+), 12 deletions(-)
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 6378d7f..0ee7d09 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -1516,6 +1516,12 @@ static void ixgbe_configure_msix(struct ixgbe_adapter *adapter)
q_vectors = adapter->num_msix_vectors - NON_Q_VECTORS;
+ /* Populate MSIX to EITR Select */
+ if (adapter->num_vfs > 32) {
+ u32 eitrsel = (1 << (adapter->num_vfs - 32)) - 1;
+ IXGBE_WRITE_REG(&adapter->hw, IXGBE_EITRSEL, eitrsel);
+ }
+
/*
* Populate the IVAR table and set the ITR values to the
* corresponding register.
@@ -2130,11 +2136,6 @@ static inline void ixgbe_irq_enable(struct ixgbe_adapter *adapter, bool queues,
ixgbe_irq_enable_queues(adapter, ~0);
if (flush)
IXGBE_WRITE_FLUSH(&adapter->hw);
-
- if (adapter->num_vfs > 32) {
- u32 eitrsel = (1 << (adapter->num_vfs - 32)) - 1;
- IXGBE_WRITE_REG(&adapter->hw, IXGBE_EITRSEL, eitrsel);
- }
}
/**
@@ -2313,8 +2314,6 @@ static inline void ixgbe_irq_disable(struct ixgbe_adapter *adapter)
IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMC, 0xFFFF0000);
IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMC_EX(0), ~0);
IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMC_EX(1), ~0);
- if (adapter->num_vfs > 32)
- IXGBE_WRITE_REG(&adapter->hw, IXGBE_EITRSEL, 0);
break;
default:
break;
@@ -3863,17 +3862,19 @@ void ixgbe_down(struct ixgbe_adapter *adapter)
del_timer_sync(&adapter->service_timer);
- /* disable receive for all VFs and wait one second */
if (adapter->num_vfs) {
+ /* Clear EITR Select mapping */
+ IXGBE_WRITE_REG(&adapter->hw, IXGBE_EITRSEL, 0);
+
+ /* Mark all the VFs as inactive */
+ for (i = 0 ; i < adapter->num_vfs; i++)
+ adapter->vfinfo[i].clear_to_send = 0;
+
/* ping all the active vfs to let them know we are going down */
ixgbe_ping_all_vfs(adapter);
/* Disable all VFTE/VFRE TX/RX */
ixgbe_disable_tx_rx(adapter);
-
- /* Mark all the VFs as inactive */
- for (i = 0 ; i < adapter->num_vfs; i++)
- adapter->vfinfo[i].clear_to_send = 0;
}
/* disable transmits in the hardware now that interrupts are off */
--
1.7.6
^ permalink raw reply related
* [net-next 09/11] ixgbe: cleanup reset paths
From: Jeff Kirsher @ 2011-09-16 4:42 UTC (permalink / raw)
To: davem; +Cc: Alexander Duyck, netdev, gospo, Jeff Kirsher
In-Reply-To: <1316148173-11209-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Alexander Duyck <alexander.h.duyck@intel.com>
The reset paths are overly complicated and are either missing steps or
contain extra unnecessary steps such as reading MAC address twice. This
change is meant to help clean up the reset paths an get things functioning
correctly.
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/ixgbe/ixgbe_82598.c | 13 ++---
drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c | 40 ++++++++------
drivers/net/ethernet/intel/ixgbe/ixgbe_type.h | 1 +
drivers/net/ethernet/intel/ixgbe/ixgbe_x540.c | 72 +++++-------------------
4 files changed, 43 insertions(+), 83 deletions(-)
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_82598.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_82598.c
index 0d4e382..22504f2 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_82598.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_82598.c
@@ -820,8 +820,8 @@ mac_reset_top:
* Issue global reset to the MAC. This needs to be a SW reset.
* If link reset is used, it might reset the MAC when mng is using it
*/
- ctrl = IXGBE_READ_REG(hw, IXGBE_CTRL);
- IXGBE_WRITE_REG(hw, IXGBE_CTRL, (ctrl | IXGBE_CTRL_RST));
+ ctrl = IXGBE_READ_REG(hw, IXGBE_CTRL) | IXGBE_CTRL_RST;
+ IXGBE_WRITE_REG(hw, IXGBE_CTRL, ctrl);
IXGBE_WRITE_FLUSH(hw);
/* Poll for reset bit to self-clear indicating reset is complete */
@@ -836,21 +836,18 @@ mac_reset_top:
hw_dbg(hw, "Reset polling failed to complete.\n");
}
+ msleep(50);
+
/*
* Double resets are required for recovery from certain error
* conditions. Between resets, it is necessary to stall to allow time
- * for any pending HW events to complete. We use 1usec since that is
- * what is needed for ixgbe_disable_pcie_master(). The second reset
- * then clears out any effects of those events.
+ * for any pending HW events to complete.
*/
if (hw->mac.flags & IXGBE_FLAGS_DOUBLE_RESET_REQUIRED) {
hw->mac.flags &= ~IXGBE_FLAGS_DOUBLE_RESET_REQUIRED;
- udelay(1);
goto mac_reset_top;
}
- msleep(50);
-
gheccr = IXGBE_READ_REG(hw, IXGBE_GHECCR);
gheccr &= ~((1 << 21) | (1 << 18) | (1 << 9) | (1 << 6));
IXGBE_WRITE_REG(hw, IXGBE_GHECCR, gheccr);
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c
index f193fc2..a5ff435 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c
@@ -904,11 +904,10 @@ static s32 ixgbe_setup_copper_link_82599(struct ixgbe_hw *hw,
**/
static s32 ixgbe_reset_hw_82599(struct ixgbe_hw *hw)
{
- s32 status = 0;
- u32 ctrl;
- u32 i;
- u32 autoc;
- u32 autoc2;
+ ixgbe_link_speed link_speed;
+ s32 status;
+ u32 ctrl, i, autoc, autoc2;
+ bool link_up = false;
/* Call adapter stop to disable tx/rx and clear interrupts */
hw->mac.ops.stop_adapter(hw);
@@ -942,40 +941,47 @@ static s32 ixgbe_reset_hw_82599(struct ixgbe_hw *hw)
mac_reset_top:
/*
- * Issue global reset to the MAC. This needs to be a SW reset.
- * If link reset is used, it might reset the MAC when mng is using it
+ * Issue global reset to the MAC. Needs to be SW reset if link is up.
+ * If link reset is used when link is up, it might reset the PHY when
+ * mng is using it. If link is down or the flag to force full link
+ * reset is set, then perform link reset.
*/
- ctrl = IXGBE_READ_REG(hw, IXGBE_CTRL);
- IXGBE_WRITE_REG(hw, IXGBE_CTRL, (ctrl | IXGBE_CTRL_RST));
+ ctrl = IXGBE_CTRL_LNK_RST;
+ if (!hw->force_full_reset) {
+ hw->mac.ops.check_link(hw, &link_speed, &link_up, false);
+ if (link_up)
+ ctrl = IXGBE_CTRL_RST;
+ }
+
+ ctrl |= IXGBE_READ_REG(hw, IXGBE_CTRL);
+ IXGBE_WRITE_REG(hw, IXGBE_CTRL, ctrl);
IXGBE_WRITE_FLUSH(hw);
/* Poll for reset bit to self-clear indicating reset is complete */
for (i = 0; i < 10; i++) {
udelay(1);
ctrl = IXGBE_READ_REG(hw, IXGBE_CTRL);
- if (!(ctrl & IXGBE_CTRL_RST))
+ if (!(ctrl & IXGBE_CTRL_RST_MASK))
break;
}
- if (ctrl & IXGBE_CTRL_RST) {
+
+ if (ctrl & IXGBE_CTRL_RST_MASK) {
status = IXGBE_ERR_RESET_FAILED;
hw_dbg(hw, "Reset polling failed to complete.\n");
}
+ msleep(50);
+
/*
* Double resets are required for recovery from certain error
* conditions. Between resets, it is necessary to stall to allow time
- * for any pending HW events to complete. We use 1usec since that is
- * what is needed for ixgbe_disable_pcie_master(). The second reset
- * then clears out any effects of those events.
+ * for any pending HW events to complete.
*/
if (hw->mac.flags & IXGBE_FLAGS_DOUBLE_RESET_REQUIRED) {
hw->mac.flags &= ~IXGBE_FLAGS_DOUBLE_RESET_REQUIRED;
- udelay(1);
goto mac_reset_top;
}
- msleep(50);
-
/*
* Store the original AUTOC/AUTOC2 values if they have not been
* stored off yet. Otherwise restore the stored original
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h b/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h
index 9f618ee..a9f8839 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h
@@ -982,6 +982,7 @@
#define IXGBE_CTRL_GIO_DIS 0x00000004 /* Global IO Master Disable bit */
#define IXGBE_CTRL_LNK_RST 0x00000008 /* Link Reset. Resets everything. */
#define IXGBE_CTRL_RST 0x04000000 /* Reset (SW) */
+#define IXGBE_CTRL_RST_MASK (IXGBE_CTRL_LNK_RST | IXGBE_CTRL_RST)
/* FACTPS */
#define IXGBE_FACTPS_LFS 0x40000000 /* LAN Function Select */
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_x540.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_x540.c
index 2696c78..bbfe8c4 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_x540.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_x540.c
@@ -94,13 +94,8 @@ static s32 ixgbe_setup_mac_link_X540(struct ixgbe_hw *hw,
static s32 ixgbe_reset_hw_X540(struct ixgbe_hw *hw)
{
ixgbe_link_speed link_speed;
- s32 status = 0;
- u32 ctrl;
- u32 ctrl_ext;
- u32 reset_bit;
- u32 i;
- u32 autoc;
- u32 autoc2;
+ s32 status;
+ u32 ctrl, i;
bool link_up = false;
/* Call adapter stop to disable tx/rx and clear interrupts */
@@ -119,53 +114,42 @@ mac_reset_top:
* mng is using it. If link is down or the flag to force full link
* reset is set, then perform link reset.
*/
- if (hw->force_full_reset) {
- reset_bit = IXGBE_CTRL_LNK_RST;
- } else {
+ ctrl = IXGBE_CTRL_LNK_RST;
+ if (!hw->force_full_reset) {
hw->mac.ops.check_link(hw, &link_speed, &link_up, false);
- if (!link_up)
- reset_bit = IXGBE_CTRL_LNK_RST;
- else
- reset_bit = IXGBE_CTRL_RST;
+ if (link_up)
+ ctrl = IXGBE_CTRL_RST;
}
- ctrl = IXGBE_READ_REG(hw, IXGBE_CTRL);
- IXGBE_WRITE_REG(hw, IXGBE_CTRL, (ctrl | reset_bit));
+ ctrl |= IXGBE_READ_REG(hw, IXGBE_CTRL);
+ IXGBE_WRITE_REG(hw, IXGBE_CTRL, ctrl);
IXGBE_WRITE_FLUSH(hw);
/* Poll for reset bit to self-clear indicating reset is complete */
for (i = 0; i < 10; i++) {
udelay(1);
ctrl = IXGBE_READ_REG(hw, IXGBE_CTRL);
- if (!(ctrl & reset_bit))
+ if (!(ctrl & IXGBE_CTRL_RST_MASK))
break;
}
- if (ctrl & reset_bit) {
+
+ if (ctrl & IXGBE_CTRL_RST_MASK) {
status = IXGBE_ERR_RESET_FAILED;
hw_dbg(hw, "Reset polling failed to complete.\n");
}
+ msleep(50);
+
/*
* Double resets are required for recovery from certain error
* conditions. Between resets, it is necessary to stall to allow time
- * for any pending HW events to complete. We use 1usec since that is
- * what is needed for ixgbe_disable_pcie_master(). The second reset
- * then clears out any effects of those events.
+ * for any pending HW events to complete.
*/
if (hw->mac.flags & IXGBE_FLAGS_DOUBLE_RESET_REQUIRED) {
hw->mac.flags &= ~IXGBE_FLAGS_DOUBLE_RESET_REQUIRED;
- udelay(1);
goto mac_reset_top;
}
- /* Clear PF Reset Done bit so PF/VF Mail Ops can work */
- ctrl_ext = IXGBE_READ_REG(hw, IXGBE_CTRL_EXT);
- ctrl_ext |= IXGBE_CTRL_EXT_PFRSTD;
- IXGBE_WRITE_REG(hw, IXGBE_CTRL_EXT, ctrl_ext);
- IXGBE_WRITE_FLUSH(hw);
-
- msleep(50);
-
/* Set the Rx packet buffer size. */
IXGBE_WRITE_REG(hw, IXGBE_RXPBSIZE(0), 384 << IXGBE_RXPBSIZE_SHIFT);
@@ -173,31 +157,6 @@ mac_reset_top:
hw->mac.ops.get_mac_addr(hw, hw->mac.perm_addr);
/*
- * Store the original AUTOC/AUTOC2 values if they have not been
- * stored off yet. Otherwise restore the stored original
- * values since the reset operation sets back to defaults.
- */
- autoc = IXGBE_READ_REG(hw, IXGBE_AUTOC);
- autoc2 = IXGBE_READ_REG(hw, IXGBE_AUTOC2);
- if (hw->mac.orig_link_settings_stored == false) {
- hw->mac.orig_autoc = autoc;
- hw->mac.orig_autoc2 = autoc2;
- hw->mac.orig_link_settings_stored = true;
- } else {
- if (autoc != hw->mac.orig_autoc)
- IXGBE_WRITE_REG(hw, IXGBE_AUTOC, (hw->mac.orig_autoc |
- IXGBE_AUTOC_AN_RESTART));
-
- if ((autoc2 & IXGBE_AUTOC2_UPPER_MASK) !=
- (hw->mac.orig_autoc2 & IXGBE_AUTOC2_UPPER_MASK)) {
- autoc2 &= ~IXGBE_AUTOC2_UPPER_MASK;
- autoc2 |= (hw->mac.orig_autoc2 &
- IXGBE_AUTOC2_UPPER_MASK);
- IXGBE_WRITE_REG(hw, IXGBE_AUTOC2, autoc2);
- }
- }
-
- /*
* Store MAC address from RAR0, clear receive address registers, and
* clear the multicast table. Also reset num_rar_entries to 128,
* since we modify this value when programming the SAN MAC address.
@@ -205,9 +164,6 @@ mac_reset_top:
hw->mac.num_rar_entries = IXGBE_X540_MAX_TX_QUEUES;
hw->mac.ops.init_rx_addrs(hw);
- /* Store the permanent mac address */
- hw->mac.ops.get_mac_addr(hw, hw->mac.perm_addr);
-
/* Store the permanent SAN mac address */
hw->mac.ops.get_san_mac_addr(hw, hw->mac.san_addr);
--
1.7.6
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox