|
@@ -186,6 +186,7 @@ static int hermon_cmd ( struct hermon *hermon, unsigned long command,
|
186
|
186
|
memset ( &hcr, 0, sizeof ( hcr ) );
|
187
|
187
|
in_buffer = &hcr.u.dwords[0];
|
188
|
188
|
if ( in_len && ( command & HERMON_HCR_IN_MBOX ) ) {
|
|
189
|
+ memset ( hermon->mailbox_in, 0, HERMON_MBOX_SIZE );
|
189
|
190
|
in_buffer = hermon->mailbox_in;
|
190
|
191
|
MLX_FILL_1 ( &hcr, 1, in_param_l, virt_to_bus ( in_buffer ) );
|
191
|
192
|
}
|
|
@@ -289,12 +290,10 @@ hermon_cmd_close_hca ( struct hermon *hermon ) {
|
289
|
290
|
}
|
290
|
291
|
|
291
|
292
|
static inline int
|
292
|
|
-hermon_cmd_init_port ( struct hermon *hermon, unsigned int port,
|
293
|
|
- const struct hermonprm_init_port *init_port ) {
|
|
293
|
+hermon_cmd_init_port ( struct hermon *hermon, unsigned int port ) {
|
294
|
294
|
return hermon_cmd ( hermon,
|
295
|
|
- HERMON_HCR_IN_CMD ( HERMON_HCR_INIT_PORT,
|
296
|
|
- 1, sizeof ( *init_port ) ),
|
297
|
|
- 0, init_port, port, NULL );
|
|
295
|
+ HERMON_HCR_VOID_CMD ( HERMON_HCR_INIT_PORT ),
|
|
296
|
+ 0, NULL, port, NULL );
|
298
|
297
|
}
|
299
|
298
|
|
300
|
299
|
static inline int
|
|
@@ -304,6 +303,15 @@ hermon_cmd_close_port ( struct hermon *hermon, unsigned int port ) {
|
304
|
303
|
0, NULL, port, NULL );
|
305
|
304
|
}
|
306
|
305
|
|
|
306
|
+static inline int
|
|
307
|
+hermon_cmd_set_port ( struct hermon *hermon, unsigned int port,
|
|
308
|
+ struct hermonprm_set_port *set_port ) {
|
|
309
|
+ return hermon_cmd ( hermon,
|
|
310
|
+ HERMON_HCR_IN_CMD ( HERMON_HCR_SET_PORT,
|
|
311
|
+ 1, sizeof ( *set_port ) ),
|
|
312
|
+ 0, set_port, port, NULL );
|
|
313
|
+}
|
|
314
|
+
|
307
|
315
|
static inline int
|
308
|
316
|
hermon_cmd_sw2hw_mpt ( struct hermon *hermon, unsigned int index,
|
309
|
317
|
const struct hermonprm_mpt *mpt ) {
|
|
@@ -1903,8 +1911,11 @@ static int hermon_sense_port_type ( struct ib_device *ibdev ) {
|
1903
|
1911
|
int rc;
|
1904
|
1912
|
|
1905
|
1913
|
/* If DPDP is not supported, always assume Infiniband */
|
1906
|
|
- if ( ! hermon->cap.dpdp )
|
|
1914
|
+ if ( ! hermon->cap.dpdp ) {
|
|
1915
|
+ DBGC ( hermon, "Hermon %p does not support DPDP; assuming "
|
|
1916
|
+ "Infiniband\n", hermon );
|
1907
|
1917
|
return HERMON_PORT_TYPE_IB;
|
|
1918
|
+ }
|
1908
|
1919
|
|
1909
|
1920
|
/* Sense the port type */
|
1910
|
1921
|
if ( ( rc = hermon_cmd_sense_port ( hermon, ibdev->port,
|
|
@@ -1928,7 +1939,7 @@ static int hermon_sense_port_type ( struct ib_device *ibdev ) {
|
1928
|
1939
|
*/
|
1929
|
1940
|
static int hermon_open ( struct ib_device *ibdev ) {
|
1930
|
1941
|
struct hermon *hermon = ib_get_drvdata ( ibdev );
|
1931
|
|
- struct hermonprm_init_port init_port;
|
|
1942
|
+ struct hermonprm_set_port set_port;
|
1932
|
1943
|
int port_type;
|
1933
|
1944
|
int rc;
|
1934
|
1945
|
|
|
@@ -1941,18 +1952,29 @@ static int hermon_open ( struct ib_device *ibdev ) {
|
1941
|
1952
|
return -ENOTCONN;
|
1942
|
1953
|
}
|
1943
|
1954
|
|
1944
|
|
- /* Init Port */
|
1945
|
|
- memset ( &init_port, 0, sizeof ( init_port ) );
|
1946
|
|
- MLX_FILL_2 ( &init_port, 0,
|
1947
|
|
- port_width_cap, 3,
|
1948
|
|
- vl_cap, 1 );
|
1949
|
|
- MLX_FILL_2 ( &init_port, 1,
|
1950
|
|
- mtu, HERMON_MTU_2048,
|
|
1955
|
+ /* Set port parameters */
|
|
1956
|
+ memset ( &set_port, 0, sizeof ( set_port ) );
|
|
1957
|
+ MLX_FILL_7 ( &set_port, 0,
|
|
1958
|
+ mmc, 1,
|
|
1959
|
+ mvc, 1,
|
|
1960
|
+ mp, 1,
|
|
1961
|
+ mg, 1,
|
|
1962
|
+ mtu_cap, IB_MTU_2048,
|
|
1963
|
+ vl_cap, IB_VL_0,
|
|
1964
|
+ rcm, 1 );
|
|
1965
|
+ MLX_FILL_2 ( &set_port, 10,
|
|
1966
|
+ max_pkey, 1,
|
1951
|
1967
|
max_gid, 1 );
|
1952
|
|
- MLX_FILL_1 ( &init_port, 2, max_pkey, 64 );
|
1953
|
|
- if ( ( rc = hermon_cmd_init_port ( hermon, ibdev->port,
|
1954
|
|
- &init_port ) ) != 0 ) {
|
1955
|
|
- DBGC ( hermon, "Hermon %p port %d could not intialise port: "
|
|
1968
|
+ if ( ( rc = hermon_cmd_set_port ( hermon, ibdev->port,
|
|
1969
|
+ &set_port ) ) != 0 ) {
|
|
1970
|
+ DBGC ( hermon, "Hermon %p port %d could not set port: %s\n",
|
|
1971
|
+ hermon, ibdev->port, strerror ( rc ) );
|
|
1972
|
+ return rc;
|
|
1973
|
+ }
|
|
1974
|
+
|
|
1975
|
+ /* Initialise port */
|
|
1976
|
+ if ( ( rc = hermon_cmd_init_port ( hermon, ibdev->port ) ) != 0 ) {
|
|
1977
|
+ DBGC ( hermon, "Hermon %p port %d could not initialise port: "
|
1956
|
1978
|
"%s\n", hermon, ibdev->port, strerror ( rc ) );
|
1957
|
1979
|
return rc;
|
1958
|
1980
|
}
|