summaryrefslogtreecommitdiff
path: root/include/linux/qed/qed_ll2_if.h
diff options
context:
space:
mode:
authorMichal Kalderon <Michal.Kalderon@cavium.com>2017-06-09 17:13:22 +0300
committerDavid S. Miller <davem@davemloft.net>2017-06-09 15:49:02 -0400
commit0518c12f1f79dc2f2020836974c577404e42ae89 (patch)
treea8efb6dd750ff4ae9c8791f5249924984bd2713b /include/linux/qed/qed_ll2_if.h
parent58de289807f02122ef7eca96e50365d2c1440902 (diff)
qed*: LL2 callback operations
LL2 today is interrupt driven - when tx/rx completion arrives [or any other indication], qed needs to operate on the connection and pass the information to the protocol-driver [or internal qed consumer]. Since we have several flavors of ll2 employeed by the driver, each handler needs to do an if-else to determine the right functionality to use based on the connection type. In order to make things more scalable [given that we're going to add additional types of ll2 flavors] move the infrastrucutre into using a callback-based approach - the callbacks would be provided as part of the connection's initialization parameters. Signed-off-by: Michal Kalderon <Michal.Kalderon@cavium.com> Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/qed/qed_ll2_if.h')
-rw-r--r--include/linux/qed/qed_ll2_if.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/include/linux/qed/qed_ll2_if.h b/include/linux/qed/qed_ll2_if.h
index a1f63eca430a..5958b45eb699 100644
--- a/include/linux/qed/qed_ll2_if.h
+++ b/include/linux/qed/qed_ll2_if.h
@@ -122,6 +122,40 @@ struct qed_ll2_comp_rx_data {
} u;
};
+typedef
+void (*qed_ll2_complete_rx_packet_cb)(void *cxt,
+ struct qed_ll2_comp_rx_data *data);
+
+typedef
+void (*qed_ll2_release_rx_packet_cb)(void *cxt,
+ u8 connection_handle,
+ void *cookie,
+ dma_addr_t rx_buf_addr,
+ bool b_last_packet);
+
+typedef
+void (*qed_ll2_complete_tx_packet_cb)(void *cxt,
+ u8 connection_handle,
+ void *cookie,
+ dma_addr_t first_frag_addr,
+ bool b_last_fragment,
+ bool b_last_packet);
+
+typedef
+void (*qed_ll2_release_tx_packet_cb)(void *cxt,
+ u8 connection_handle,
+ void *cookie,
+ dma_addr_t first_frag_addr,
+ bool b_last_fragment, bool b_last_packet);
+
+struct qed_ll2_cbs {
+ qed_ll2_complete_rx_packet_cb rx_comp_cb;
+ qed_ll2_release_rx_packet_cb rx_release_cb;
+ qed_ll2_complete_tx_packet_cb tx_comp_cb;
+ qed_ll2_release_tx_packet_cb tx_release_cb;
+ void *cookie;
+};
+
struct qed_ll2_acquire_data_inputs {
enum qed_ll2_conn_type conn_type;
u16 mtu;
@@ -140,6 +174,8 @@ struct qed_ll2_acquire_data_inputs {
struct qed_ll2_acquire_data {
struct qed_ll2_acquire_data_inputs input;
+ const struct qed_ll2_cbs *cbs;
+
/* Output container for LL2 connection's handle */
u8 *p_connection_handle;
};