net/smc: cleanup smc_llc.h and smc_clc.h headers
authorStefan Raspl <stefan.raspl@de.ibm.com>
Thu, 1 Mar 2018 12:51:26 +0000 (13:51 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 1 Mar 2018 18:21:31 +0000 (13:21 -0500)
Remove structures used internal only from headers.
And remove an extra function parameter.

Signed-off-by: Stefan Raspl <raspl@linux.vnet.ibm.com>
Signed-off-by: Ursula Braun <ubraun@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/smc/af_smc.c
net/smc/smc_clc.c
net/smc/smc_clc.h
net/smc/smc_llc.c
net/smc/smc_llc.h

index 38ae22b65e778b7f9d4e3cc0afa4f0c98c211479..b1961a7898371c386727ce1166a34f54ff6a9426 100644 (file)
@@ -312,7 +312,7 @@ out:
        return rc;
 }
 
-static int smc_clnt_conf_first_link(struct smc_sock *smc, union ib_gid *gid)
+static int smc_clnt_conf_first_link(struct smc_sock *smc)
 {
        struct smc_link_group *lgr = smc->conn.lgr;
        struct smc_link *link;
@@ -346,7 +346,8 @@ static int smc_clnt_conf_first_link(struct smc_sock *smc, union ib_gid *gid)
        /* send CONFIRM LINK response over RoCE fabric */
        rc = smc_llc_send_confirm_link(link,
                                       link->smcibdev->mac[link->ibport - 1],
-                                      gid, SMC_LLC_RESP);
+                                      &link->smcibdev->gid[link->ibport - 1],
+                                      SMC_LLC_RESP);
        if (rc < 0)
                return SMC_CLC_DECL_TCL;
 
@@ -498,8 +499,7 @@ static int smc_connect_rdma(struct smc_sock *smc)
 
        if (local_contact == SMC_FIRST_CONTACT) {
                /* QP confirmation over RoCE fabric */
-               reason_code = smc_clnt_conf_first_link(
-                       smc, &smcibdev->gid[ibport - 1]);
+               reason_code = smc_clnt_conf_first_link(smc);
                if (reason_code < 0) {
                        rc = reason_code;
                        goto out_err_unlock;
index 8ac51583a063ca27449c52b296e0b3372d635261..dff318a2d5bf416ff152df9e66c7f51fd7e522d5 100644 (file)
@@ -22,6 +22,9 @@
 #include "smc_clc.h"
 #include "smc_ib.h"
 
+/* eye catcher "SMCR" EBCDIC for CLC messages */
+static const char SMC_EYECATCHER[4] = {'\xe2', '\xd4', '\xc3', '\xd9'};
+
 /* check if received message has a correct header length and contains valid
  * heading and trailing eyecatchers
  */
index c145a0f36a68caafc01c28620df246d29f0ef1ab..aab3aae2a2ceadce994961a07c6b8fad3d868c50 100644 (file)
@@ -22,9 +22,6 @@
 #define SMC_CLC_CONFIRM                0x03
 #define SMC_CLC_DECLINE                0x04
 
-/* eye catcher "SMCR" EBCDIC for CLC messages */
-static const char SMC_EYECATCHER[4] = {'\xe2', '\xd4', '\xc3', '\xd9'};
-
 #define SMC_CLC_V1             0x1             /* SMC version                */
 #define CLC_WAIT_TIME          (6 * HZ)        /* max. wait time on clcsock  */
 #define SMC_CLC_DECL_MEM       0x01010000  /* insufficient memory resources  */
@@ -124,9 +121,6 @@ smc_clc_proposal_get_prefix(struct smc_clc_msg_proposal *pclc)
               ((u8 *)pclc + sizeof(*pclc) + ntohs(pclc->iparea_offset));
 }
 
-struct smc_sock;
-struct smc_ib_device;
-
 int smc_clc_wait_msg(struct smc_sock *smc, void *buf, int buflen,
                     u8 expected_type);
 int smc_clc_send_decline(struct smc_sock *smc, u32 peer_diag_info);
index 92fe4cc8c82c2f0e860c40e40e61e1fa1ccea427..e4502bbff33d8e76b8189b8023cd588e50c8e138 100644 (file)
 #include "smc_clc.h"
 #include "smc_llc.h"
 
+#define SMC_LLC_DATA_LEN               40
+
+struct smc_llc_hdr {
+       struct smc_wr_rx_hdr common;
+       u8 length;      /* 44 */
+       u8 reserved;
+       u8 flags;
+};
+
+struct smc_llc_msg_confirm_link {      /* type 0x01 */
+       struct smc_llc_hdr hd;
+       u8 sender_mac[ETH_ALEN];
+       u8 sender_gid[SMC_GID_SIZE];
+       u8 sender_qp_num[3];
+       u8 link_num;
+       u8 link_uid[SMC_LGR_ID_SIZE];
+       u8 max_links;
+       u8 reserved[9];
+};
+
+union smc_llc_msg {
+       struct smc_llc_msg_confirm_link confirm_link;
+       struct {
+               struct smc_llc_hdr hdr;
+               u8 data[SMC_LLC_DATA_LEN];
+       } raw;
+};
+
+#define SMC_LLC_FLAG_RESP              0x80
+
 /********************************** send *************************************/
 
 struct smc_llc_tx_pend {
index 51b27ce90dbd25dfbbfb23a57e3253021f971bd9..a7888607ab53f12a4a5161e56af8ec7261ecf3d2 100644 (file)
@@ -28,34 +28,6 @@ enum smc_llc_msg_type {
        SMC_LLC_CONFIRM_LINK            = 0x01,
 };
 
-#define SMC_LLC_DATA_LEN               40
-
-struct smc_llc_hdr {
-       struct smc_wr_rx_hdr common;
-       u8 length;      /* 44 */
-       u8 reserved;
-       u8 flags;
-};
-
-struct smc_llc_msg_confirm_link {      /* type 0x01 */
-       struct smc_llc_hdr hd;
-       u8 sender_mac[ETH_ALEN];
-       u8 sender_gid[SMC_GID_SIZE];
-       u8 sender_qp_num[3];
-       u8 link_num;
-       u8 link_uid[SMC_LGR_ID_SIZE];
-       u8 max_links;
-       u8 reserved[9];
-};
-
-union smc_llc_msg {
-       struct smc_llc_msg_confirm_link confirm_link;
-       struct {
-               struct smc_llc_hdr hdr;
-               u8 data[SMC_LLC_DATA_LEN];
-       } raw;
-};
-
 /* transmit */
 int smc_llc_send_confirm_link(struct smc_link *lnk, u8 mac[], union ib_gid *gid,
                              enum smc_llc_reqresp reqresp);