static void
be_get_drvinfo(struct net_device *netdev, struct ethtool_drvinfo *drvinfo)
{
- struct be_net_object *pnob = netdev->priv;
+ struct be_net_object *pnob = netdev_priv(netdev);
struct be_adapter *adapter = pnob->adapter;
strncpy(drvinfo->driver, be_driver_name, 32);
static int
be_get_coalesce(struct net_device *netdev, struct ethtool_coalesce *coalesce)
{
- struct be_net_object *pnob = netdev->priv;
+ struct be_net_object *pnob = netdev_priv(netdev);
struct be_adapter *adapter = pnob->adapter;
coalesce->rx_max_coalesced_frames = adapter->max_rx_coal;
static int
be_set_coalesce(struct net_device *netdev, struct ethtool_coalesce *coalesce)
{
- struct be_net_object *pnob = netdev->priv;
+ struct be_net_object *pnob = netdev_priv(netdev);
struct be_adapter *adapter = pnob->adapter;
struct be_eq_object *eq_objectp;
u32 max, min, cur;
static u32 be_get_rx_csum(struct net_device *netdev)
{
- struct be_net_object *pnob = netdev->priv;
+ struct be_net_object *pnob = netdev_priv(netdev);
struct be_adapter *adapter = pnob->adapter;
return adapter->rx_csum;
}
static int be_set_rx_csum(struct net_device *netdev, uint32_t data)
{
- struct be_net_object *pnob = netdev->priv;
+ struct be_net_object *pnob = netdev_priv(netdev);
struct be_adapter *adapter = pnob->adapter;
if (data)
be_get_ethtool_stats(struct net_device *netdev,
struct ethtool_stats *stats, uint64_t *data)
{
- struct be_net_object *pnob = netdev->priv;
+ struct be_net_object *pnob = netdev_priv(netdev);
struct be_adapter *adapter = pnob->adapter;
int i;
static void
be_get_ringparam(struct net_device *netdev, struct ethtool_ringparam *ring)
{
- struct be_net_object *pnob = netdev->priv;
+ struct be_net_object *pnob = netdev_priv(netdev);
/* Pre Set Maxims */
ring->rx_max_pending = pnob->rx_q_len;
static void
be_get_pauseparam(struct net_device *netdev, struct ethtool_pauseparam *ecmd)
{
- struct be_net_object *pnob = netdev->priv;
+ struct be_net_object *pnob = netdev_priv(netdev);
bool rxfc, txfc;
int status;
static int
be_set_pauseparam(struct net_device *netdev, struct ethtool_pauseparam *ecmd)
{
- struct be_net_object *pnob = netdev->priv;
+ struct be_net_object *pnob = netdev_priv(netdev);
bool txfc, rxfc;
int status;
status = -ENOMEM;
goto cleanup;
}
- pnob = netdev->priv;
+ pnob = netdev_priv(netdev);
adapter->net_obj = pnob;
adapter->netdevp = netdev;
pnob->adapter = adapter;
{
struct be_adapter *adapter = pci_get_drvdata(pdev);
struct net_device *netdev = adapter->netdevp;
- struct be_net_object *pnob = (struct be_net_object *)netdev->priv;
+ struct be_net_object *pnob = netdev_priv(netdev);
adapter->dev_pm_state = adapter->dev_state;
adapter->dev_state = BE_DEV_STATE_SUSPEND;
int status = 0;
struct be_adapter *adapter = pci_get_drvdata(pdev);
struct net_device *netdev = adapter->netdevp;
- struct be_net_object *pnob = (struct be_net_object *)netdev->priv;
+ struct be_net_object *pnob = netdev_priv(netdev);
netif_device_detach(netdev);
irqreturn_t be_int(int irq, void *dev)
{
struct net_device *netdev = dev;
- struct be_net_object *pnob = (struct be_net_object *)(netdev->priv);
+ struct be_net_object *pnob = netdev_priv(netdev);
struct be_adapter *adapter = pnob->adapter;
u32 isr;
int be_poll(struct napi_struct *napi, int budget)
{
struct net_device *netdev = napi->dev;
- struct be_net_object *pnob = (struct be_net_object *)netdev->priv;
+ struct be_net_object *pnob = netdev_priv(netdev);
struct be_adapter *adapter = pnob->adapter;
u32 work_done;
static int benet_open(struct net_device *netdev)
{
- struct be_net_object *pnob = (struct be_net_object *)netdev->priv;
+ struct be_net_object *pnob = netdev_priv(netdev);
struct be_adapter *adapter = pnob->adapter;
struct net_lro_mgr *lro_mgr;
static int benet_close(struct net_device *netdev)
{
- struct be_net_object *pnob = (struct be_net_object *)netdev->priv;
+ struct be_net_object *pnob = netdev_priv(netdev);
struct be_adapter *adapter = pnob->adapter;
netif_stop_queue(netdev);
static int benet_set_mac_addr(struct net_device *netdev, void *p)
{
struct sockaddr *addr = p;
- struct be_net_object *pnob;
-
- pnob = (struct be_net_object *)netdev->priv;
+ struct be_net_object *pnob = netdev_priv(netdev);
memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len);
be_rxf_mac_address_read_write(&pnob->fn_obj, 0, 0, false, true, false,
struct net_device_stats *benet_get_stats(struct net_device *dev)
{
- struct be_net_object *pnob = dev->priv;
+ struct be_net_object *pnob = netdev_priv(dev);
struct be_adapter *adapter = pnob->adapter;
u64 pa;
struct be_timer_ctxt *ctxt = &adapter->timer_ctxt;
static int benet_xmit(struct sk_buff *skb, struct net_device *netdev)
{
- struct be_net_object *pnob = netdev->priv;
+ struct be_net_object *pnob = netdev_priv(netdev);
struct be_adapter *adapter = pnob->adapter;
u32 wrb_cnt, copied = 0;
u32 start = pnob->tx_q_hd;
static void benet_vlan_register(struct net_device *netdev,
struct vlan_group *grp)
{
- struct be_net_object *pnob = netdev->priv;
+ struct be_net_object *pnob = netdev_priv(netdev);
be_disable_eq_intr(pnob);
pnob->vlan_grp = grp;
*/
static void benet_vlan_add_vid(struct net_device *netdev, u16 vlan_id)
{
- struct be_net_object *pnob = netdev->priv;
+ struct be_net_object *pnob = netdev_priv(netdev);
if (pnob->num_vlans == (BE_NUM_VLAN_SUPPORTED - 1)) {
/* no way to return an error */
*/
static void benet_vlan_rem_vid(struct net_device *netdev, u16 vlan_id)
{
- struct be_net_object *pnob = netdev->priv;
+ struct be_net_object *pnob = netdev_priv(netdev);
u32 i, value;
*/
static void be_set_multicast_filter(struct net_device *netdev)
{
- struct be_net_object *pnob = netdev->priv;
+ struct be_net_object *pnob = netdev_priv(netdev);
struct dev_mc_list *mc_ptr;
u8 mac_addr[32][ETH_ALEN];
int i;
*/
static void benet_set_multicast_list(struct net_device *netdev)
{
- struct be_net_object *pnob = netdev->priv;
+ struct be_net_object *pnob = netdev_priv(netdev);
if (netdev->flags & IFF_PROMISC) {
be_rxf_promiscuous(&pnob->fn_obj, 1, 1, NULL, NULL, NULL);
int benet_init(struct net_device *netdev)
{
- struct be_net_object *pnob = netdev->priv;
+ struct be_net_object *pnob = netdev_priv(netdev);
struct be_adapter *adapter = pnob->adapter;
ether_setup(netdev);