瀏覽代碼

[hermon] Add infrastructure for Ethernet devices

Add PRM structures to support Hermon Ethernet devices.

Signed-off-by: Itay Gazit <itaygazit@gmail.com>
Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Itay Gazit 15 年之前
父節點
當前提交
ed0ea7cfc2
共有 2 個文件被更改,包括 156 次插入8 次删除
  1. 4
    4
      src/drivers/infiniband/hermon.c
  2. 152
    4
      src/drivers/infiniband/hermon.h

+ 4
- 4
src/drivers/infiniband/hermon.c 查看文件

@@ -305,7 +305,7 @@ hermon_cmd_close_port ( struct hermon *hermon, unsigned int port ) {
305 305
 
306 306
 static inline int
307 307
 hermon_cmd_set_port ( struct hermon *hermon, unsigned int port,
308
-		      struct hermonprm_set_port *set_port ) {
308
+		      union hermonprm_set_port *set_port ) {
309 309
 	return hermon_cmd ( hermon,
310 310
 			    HERMON_HCR_IN_CMD ( HERMON_HCR_SET_PORT,
311 311
 						1, sizeof ( *set_port ) ),
@@ -1939,7 +1939,7 @@ static int hermon_sense_port_type ( struct ib_device *ibdev ) {
1939 1939
  */
1940 1940
 static int hermon_open ( struct ib_device *ibdev ) {
1941 1941
 	struct hermon *hermon = ib_get_drvdata ( ibdev );
1942
-	struct hermonprm_set_port set_port;
1942
+	union hermonprm_set_port set_port;
1943 1943
 	int port_type;
1944 1944
 	int rc;
1945 1945
 
@@ -1954,7 +1954,7 @@ static int hermon_open ( struct ib_device *ibdev ) {
1954 1954
 
1955 1955
 	/* Set port parameters */
1956 1956
 	memset ( &set_port, 0, sizeof ( set_port ) );
1957
-	MLX_FILL_7 ( &set_port, 0,
1957
+	MLX_FILL_7 ( &set_port.ib, 0,
1958 1958
 		     mmc, 1,
1959 1959
 		     mvc, 1,
1960 1960
 		     mp, 1,
@@ -1962,7 +1962,7 @@ static int hermon_open ( struct ib_device *ibdev ) {
1962 1962
 		     mtu_cap, IB_MTU_2048,
1963 1963
 		     vl_cap, IB_VL_0,
1964 1964
 		     rcm, 1 );
1965
-	MLX_FILL_2 ( &set_port, 10,
1965
+	MLX_FILL_2 ( &set_port.ib, 10,
1966 1966
 		     max_pkey, 1,
1967 1967
 		     max_gid, 1 );
1968 1968
 	if ( ( rc = hermon_cmd_set_port ( hermon, ibdev->port,

+ 152
- 4
src/drivers/infiniband/hermon.h 查看文件

@@ -68,6 +68,8 @@ FILE_LICENCE ( GPL2_OR_LATER );
68 68
 #define HERMON_HCR_READ_MCG		0x0025
69 69
 #define HERMON_HCR_WRITE_MCG		0x0026
70 70
 #define HERMON_HCR_MGID_HASH		0x0027
71
+#define HERMON_HCR_MOD_STAT_CFG		0x0034
72
+#define HERMON_HCR_QUERY_PORT		0x0043
71 73
 #define HERMON_HCR_SENSE_PORT		0x004d
72 74
 #define HERMON_HCR_RUN_FW		0x0ff6
73 75
 #define HERMON_HCR_DISABLE_LAM		0x0ff7
@@ -86,7 +88,9 @@ FILE_LICENCE ( GPL2_OR_LATER );
86 88
 #define HERMON_ST_MLX			0x07
87 89
 
88 90
 /* Port types */
91
+#define HERMON_PORT_TYPE_UNKNOWN	0
89 92
 #define HERMON_PORT_TYPE_IB		1
93
+#define HERMON_PORT_TYPE_ETH		2
90 94
 
91 95
 /* MTUs */
92 96
 #define HERMON_MTU_2048			0x04
@@ -191,16 +195,18 @@ struct hermonprm_event_mask_st {
191 195
 
192 196
 struct hermonprm_port_state_change_event_st {
193 197
 	pseudo_bit_t reserved[0x00020];
198
+/* -------------- */
194 199
 	struct hermonprm_port_state_change_st data;
195 200
 } __attribute__ (( packed ));
196 201
 
197 202
 struct hermonprm_sense_port_st {
198
-	pseudo_bit_t port_type[0x00020];
203
+	pseudo_bit_t reserved0[0x00020];
199 204
 /* -------------- */
200
-	pseudo_bit_t reserved[0x00020];
205
+	pseudo_bit_t port_type[0x00002];
206
+	pseudo_bit_t reserved1[0x00018];
201 207
 } __attribute__ (( packed ));
202 208
 
203
-struct hermonprm_set_port_st {
209
+struct hermonprm_set_port_ib_st {
204 210
 	pseudo_bit_t rqk[0x00001];
205 211
 	pseudo_bit_t rcm[0x00001];
206 212
 	pseudo_bit_t reserved0[0x00002];
@@ -242,6 +248,134 @@ struct hermonprm_set_port_st {
242 248
 	pseudo_bit_t max_pkey[0x00010];
243 249
 } __attribute__ (( packed ));
244 250
 
251
+struct hermonprm_query_port_cap_st {
252
+	pseudo_bit_t eth_mtu[0x00010];
253
+	pseudo_bit_t ib_mtu[0x00004];
254
+	pseudo_bit_t reserved0[0x00004];
255
+	pseudo_bit_t ib[0x00001];
256
+	pseudo_bit_t eth[0x00001];
257
+	pseudo_bit_t reserved1[0x00005];
258
+	pseudo_bit_t link_state[0x00001];
259
+/* -------------- */
260
+	pseudo_bit_t log_max_pkey[0x00004];
261
+	pseudo_bit_t log_max_gid[0x00004];
262
+	pseudo_bit_t ib_port_width[0x00004];
263
+	pseudo_bit_t reserved2[0x00004];
264
+	pseudo_bit_t eth_link_speed[0x00004];
265
+	pseudo_bit_t reserved3[0x00004];
266
+	pseudo_bit_t ib_link_speed[0x00004];
267
+	pseudo_bit_t reserved4[0x00004];
268
+/* -------------- */
269
+	pseudo_bit_t max_vl_ib[0x00004];
270
+	pseudo_bit_t reserved5[0x00004];
271
+	pseudo_bit_t log_max_mac[0x00004];
272
+	pseudo_bit_t log_max_vlan[0x00004];
273
+	pseudo_bit_t reserved6[0x00010];
274
+/* -------------- */
275
+	pseudo_bit_t reserved7[0x00020];
276
+/* -------------- */
277
+	pseudo_bit_t mac_47_32[0x00010];
278
+	pseudo_bit_t reserved8[0x00010];
279
+/* -------------- */
280
+	pseudo_bit_t mac_31_0[0x00020];
281
+/* -------------- */
282
+	pseudo_bit_t vendor_oui[0x00018];
283
+	pseudo_bit_t transceiver_type[0x00008];
284
+/* -------------- */
285
+	pseudo_bit_t reserved9[0x00010];
286
+	pseudo_bit_t wavelength[0x00010];
287
+/* -------------- */
288
+	pseudo_bit_t transceiver_code_hi[0x00020];
289
+/* -------------- */
290
+	pseudo_bit_t transceiver_code_lo[0x00020];
291
+/* -------------- */
292
+	pseudo_bit_t reserved10[0x000c0];
293
+} __attribute__ (( packed ));
294
+
295
+struct hermonprm_set_port_general_context_st {
296
+	pseudo_bit_t v_mtu[0x00001];
297
+	pseudo_bit_t v_pprx[0x00001];
298
+	pseudo_bit_t v_pptx[0x00001];
299
+	pseudo_bit_t reserved0[0x0001d];
300
+/* -------------- */
301
+	pseudo_bit_t mtu[0x00010];
302
+	pseudo_bit_t reserved1[0x00010];
303
+/* -------------- */
304
+	pseudo_bit_t reserved2[0x00010];
305
+	pseudo_bit_t pfctx[0x00008];
306
+	pseudo_bit_t reserved3[0x00007];
307
+	pseudo_bit_t pptx[0x00001];
308
+/* -------------- */
309
+	pseudo_bit_t reserved4[0x00010];
310
+	pseudo_bit_t pfcrx[0x00008];
311
+	pseudo_bit_t reserved5[0x00007];
312
+	pseudo_bit_t pprx[0x00001];
313
+/* -------------- */
314
+} __attribute__ (( packed ));
315
+
316
+struct hermonprm_set_port_rqp_calc_st {
317
+	pseudo_bit_t base_qpn[0x00018];
318
+	pseudo_bit_t reserved0[0x00008];
319
+/* -------------- */
320
+	pseudo_bit_t n_p[0x00002];
321
+	pseudo_bit_t reserved1[0x00006];
322
+	pseudo_bit_t n_v[0x00003];
323
+	pseudo_bit_t reserved2[0x00005];
324
+	pseudo_bit_t n_m[0x00004];
325
+	pseudo_bit_t reserved3[0x0000c];
326
+/* -------------- */
327
+	pseudo_bit_t mac_miss_index[0x00008];
328
+	pseudo_bit_t reserved4[0x00018];
329
+/* -------------- */
330
+	pseudo_bit_t vlan_miss_index[0x00007];
331
+	pseudo_bit_t reserved5[0x00008];
332
+	pseudo_bit_t intra_miss[0x00001];
333
+	pseudo_bit_t no_vlan_index[0x00007];
334
+	pseudo_bit_t reserved6[0x00008];
335
+	pseudo_bit_t intra_no_vlan[0x00001];
336
+/* -------------- */
337
+	pseudo_bit_t no_vlan_prio[0x00003];
338
+	pseudo_bit_t reserved7[0x0001d];
339
+/* -------------- */
340
+	pseudo_bit_t promisc_qpn[0x00018];
341
+	pseudo_bit_t reserved8[0x00007];
342
+	pseudo_bit_t en_uc_promisc[0x00001];
343
+/* -------------- */
344
+	pseudo_bit_t def_mcast_qpn[0x00018];
345
+	pseudo_bit_t reserved9[0x00005];
346
+	pseudo_bit_t mc_by_vlan[0x00001];
347
+	pseudo_bit_t mc_promisc_mode[0x00002];
348
+/* -------------- */
349
+	pseudo_bit_t reserved10[0x00020];
350
+/* -------------- */
351
+} __attribute__ (( packed ));
352
+
353
+struct hermonprm_set_port_mac_table_st {
354
+	pseudo_bit_t mac_h[0x00010];
355
+	pseudo_bit_t reserved0[0x0000f];
356
+	pseudo_bit_t v[0x00001];
357
+/* -------------- */
358
+	pseudo_bit_t mac_l[0x00020];
359
+/* -------------- */
360
+} __attribute__ (( packed ));
361
+
362
+struct hermonprm_set_port_vlan_st {
363
+	pseudo_bit_t vlan_id[0x0000c];
364
+	pseudo_bit_t reserved0[0x00012];
365
+	pseudo_bit_t intra[0x00001];
366
+	pseudo_bit_t v[0x00001];
367
+/* -------------- */
368
+} __attribute__ (( packed ));
369
+
370
+struct hermonprm_mod_stat_cfg_pf_net_boot_st {
371
+	pseudo_bit_t reserved1[0x0001c];
372
+	pseudo_bit_t pf_net_boot[0x00001];
373
+	pseudo_bit_t reserved2[0x00002];
374
+	pseudo_bit_t pf_net_boot_m[0x00001];
375
+/* -------------- */
376
+	pseudo_bit_t reserved0[0x00020];
377
+} __attribute__ (( packed ));
378
+
245 379
 /*
246 380
  * Wrapper structures for hardware datatypes
247 381
  *
@@ -260,6 +394,7 @@ struct MLX_DECLARE_STRUCT ( hermonprm_init_hca );
260 394
 struct MLX_DECLARE_STRUCT ( hermonprm_mad_ifc );
261 395
 struct MLX_DECLARE_STRUCT ( hermonprm_mcg_entry );
262 396
 struct MLX_DECLARE_STRUCT ( hermonprm_mgm_hash );
397
+struct MLX_DECLARE_STRUCT ( hermonprm_mod_stat_cfg_pf_net_boot );
263 398
 struct MLX_DECLARE_STRUCT ( hermonprm_mpt );
264 399
 struct MLX_DECLARE_STRUCT ( hermonprm_mtt );
265 400
 struct MLX_DECLARE_STRUCT ( hermonprm_port_state_change_event );
@@ -267,11 +402,16 @@ struct MLX_DECLARE_STRUCT ( hermonprm_qp_db_record );
267 402
 struct MLX_DECLARE_STRUCT ( hermonprm_qp_ee_state_transitions );
268 403
 struct MLX_DECLARE_STRUCT ( hermonprm_query_dev_cap );
269 404
 struct MLX_DECLARE_STRUCT ( hermonprm_query_fw );
405
+struct MLX_DECLARE_STRUCT ( hermonprm_query_port_cap );
270 406
 struct MLX_DECLARE_STRUCT ( hermonprm_queue_pair_ee_context_entry );
271 407
 struct MLX_DECLARE_STRUCT ( hermonprm_scalar_parameter );
272 408
 struct MLX_DECLARE_STRUCT ( hermonprm_sense_port );
273 409
 struct MLX_DECLARE_STRUCT ( hermonprm_send_db_register );
274
-struct MLX_DECLARE_STRUCT ( hermonprm_set_port );
410
+struct MLX_DECLARE_STRUCT ( hermonprm_set_port_ib );
411
+struct MLX_DECLARE_STRUCT ( hermonprm_set_port_general_context );
412
+struct MLX_DECLARE_STRUCT ( hermonprm_set_port_mac_table );
413
+struct MLX_DECLARE_STRUCT ( hermonprm_set_port_rqp_calc );
414
+struct MLX_DECLARE_STRUCT ( hermonprm_set_port_vlan );
275 415
 struct MLX_DECLARE_STRUCT ( hermonprm_ud_address_vector );
276 416
 struct MLX_DECLARE_STRUCT ( hermonprm_virtual_physical_mapping );
277 417
 struct MLX_DECLARE_STRUCT ( hermonprm_wqe_segment_ctrl_mlx );
@@ -336,6 +476,14 @@ union hermonprm_mad {
336 476
 	union ib_mad mad;
337 477
 } __attribute__ (( packed ));
338 478
 
479
+union hermonprm_set_port {
480
+	struct hermonprm_set_port_ib ib;
481
+	struct hermonprm_set_port_general_context general;
482
+	struct hermonprm_set_port_rqp_calc rqp_calc;
483
+	struct hermonprm_set_port_mac_table mac_table[128];
484
+	struct hermonprm_set_port_vlan vlan;
485
+} __attribute__ (( packed ));
486
+
339 487
 /*
340 488
  * iPXE-specific definitions
341 489
  *

Loading…
取消
儲存