diff options
author | Shannon Nelson <snelson@pensando.io> | 2019-09-03 15:28:12 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-09-05 09:24:43 +0200 |
commit | beead698b1736dfa4061dd2e3fe3efef6d0c49b4 (patch) | |
tree | f40126fc6afdcdff46c32d356a68edbb5b8d2c0b /drivers/net/ethernet/pensando/ionic/ionic_lif.h | |
parent | ionic: Add notifyq support (diff) | |
download | linux-dev-beead698b1736dfa4061dd2e3fe3efef6d0c49b4.tar.xz linux-dev-beead698b1736dfa4061dd2e3fe3efef6d0c49b4.zip |
ionic: Add the basic NDO callbacks for netdev support
Set up the initial NDO structure and callbacks for netdev
to use, and register the netdev. This will allow us to do
a few basic operations on the device, but no traffic yet.
Signed-off-by: Shannon Nelson <snelson@pensando.io>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/pensando/ionic/ionic_lif.h')
-rw-r--r-- | drivers/net/ethernet/pensando/ionic/ionic_lif.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.h b/drivers/net/ethernet/pensando/ionic/ionic_lif.h index 7bbe818893b7..1d9a35745bce 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.h +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.h @@ -59,6 +59,8 @@ struct ionic_qcq { enum ionic_lif_state_flags { IONIC_LIF_INITED, + IONIC_LIF_UP, + IONIC_LIF_QUEUE_RESET, /* leave this as last */ IONIC_LIF_STATE_SIZE @@ -82,6 +84,7 @@ struct ionic_lif { u64 last_eid; unsigned int neqs; unsigned int nxqs; + u64 hw_features; struct ionic_lif_info *info; dma_addr_t info_pa; @@ -93,14 +96,31 @@ struct ionic_lif { u32 flags; }; +static inline int ionic_wait_for_bit(struct ionic_lif *lif, int bitname) +{ + unsigned long tlimit = jiffies + HZ; + + while (test_and_set_bit(bitname, lif->state) && + time_before(jiffies, tlimit)) + usleep_range(100, 200); + + return test_bit(bitname, lif->state); +} + int ionic_lifs_alloc(struct ionic *ionic); void ionic_lifs_free(struct ionic *ionic); void ionic_lifs_deinit(struct ionic *ionic); int ionic_lifs_init(struct ionic *ionic); +int ionic_lifs_register(struct ionic *ionic); +void ionic_lifs_unregister(struct ionic *ionic); int ionic_lif_identify(struct ionic *ionic, u8 lif_type, union ionic_lif_identity *lif_ident); int ionic_lifs_size(struct ionic *ionic); +int ionic_open(struct net_device *netdev); +int ionic_stop(struct net_device *netdev); +int ionic_reset_queues(struct ionic_lif *lif); + static inline void debug_stats_napi_poll(struct ionic_qcq *qcq, unsigned int work_done) { |