This source file includes following definitions.
- ice_aq_send_msg_to_vf
- ice_conv_link_speed_to_virtchnl
1
2
3
4 #include "ice_common.h"
5 #include "ice_adminq_cmd.h"
6 #include "ice_sriov.h"
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 enum ice_status
23 ice_aq_send_msg_to_vf(struct ice_hw *hw, u16 vfid, u32 v_opcode, u32 v_retval,
24 u8 *msg, u16 msglen, struct ice_sq_cd *cd)
25 {
26 struct ice_aqc_pf_vf_msg *cmd;
27 struct ice_aq_desc desc;
28
29 ice_fill_dflt_direct_cmd_desc(&desc, ice_mbx_opc_send_msg_to_vf);
30
31 cmd = &desc.params.virt;
32 cmd->id = cpu_to_le32(vfid);
33
34 desc.cookie_high = cpu_to_le32(v_opcode);
35 desc.cookie_low = cpu_to_le32(v_retval);
36
37 if (msglen)
38 desc.flags |= cpu_to_le16(ICE_AQ_FLAG_RD);
39
40 return ice_sq_send_cmd(hw, &hw->mailboxq, &desc, msg, msglen, cd);
41 }
42
43
44
45
46
47
48
49
50
51
52
53
54
55 u32 ice_conv_link_speed_to_virtchnl(bool adv_link_support, u16 link_speed)
56 {
57 u32 speed;
58
59 if (adv_link_support)
60 switch (link_speed) {
61 case ICE_AQ_LINK_SPEED_10MB:
62 speed = ICE_LINK_SPEED_10MBPS;
63 break;
64 case ICE_AQ_LINK_SPEED_100MB:
65 speed = ICE_LINK_SPEED_100MBPS;
66 break;
67 case ICE_AQ_LINK_SPEED_1000MB:
68 speed = ICE_LINK_SPEED_1000MBPS;
69 break;
70 case ICE_AQ_LINK_SPEED_2500MB:
71 speed = ICE_LINK_SPEED_2500MBPS;
72 break;
73 case ICE_AQ_LINK_SPEED_5GB:
74 speed = ICE_LINK_SPEED_5000MBPS;
75 break;
76 case ICE_AQ_LINK_SPEED_10GB:
77 speed = ICE_LINK_SPEED_10000MBPS;
78 break;
79 case ICE_AQ_LINK_SPEED_20GB:
80 speed = ICE_LINK_SPEED_20000MBPS;
81 break;
82 case ICE_AQ_LINK_SPEED_25GB:
83 speed = ICE_LINK_SPEED_25000MBPS;
84 break;
85 case ICE_AQ_LINK_SPEED_40GB:
86 speed = ICE_LINK_SPEED_40000MBPS;
87 break;
88 case ICE_AQ_LINK_SPEED_50GB:
89 speed = ICE_LINK_SPEED_50000MBPS;
90 break;
91 case ICE_AQ_LINK_SPEED_100GB:
92 speed = ICE_LINK_SPEED_100000MBPS;
93 break;
94 default:
95 speed = ICE_LINK_SPEED_UNKNOWN;
96 break;
97 }
98 else
99
100
101
102
103
104 switch (link_speed) {
105 case ICE_AQ_LINK_SPEED_10MB:
106 case ICE_AQ_LINK_SPEED_100MB:
107 speed = (u32)VIRTCHNL_LINK_SPEED_100MB;
108 break;
109 case ICE_AQ_LINK_SPEED_1000MB:
110 case ICE_AQ_LINK_SPEED_2500MB:
111 case ICE_AQ_LINK_SPEED_5GB:
112 speed = (u32)VIRTCHNL_LINK_SPEED_1GB;
113 break;
114 case ICE_AQ_LINK_SPEED_10GB:
115 speed = (u32)VIRTCHNL_LINK_SPEED_10GB;
116 break;
117 case ICE_AQ_LINK_SPEED_20GB:
118 speed = (u32)VIRTCHNL_LINK_SPEED_20GB;
119 break;
120 case ICE_AQ_LINK_SPEED_25GB:
121 speed = (u32)VIRTCHNL_LINK_SPEED_25GB;
122 break;
123 case ICE_AQ_LINK_SPEED_40GB:
124
125 case ICE_AQ_LINK_SPEED_50GB:
126
127 case ICE_AQ_LINK_SPEED_100GB:
128 speed = (u32)VIRTCHNL_LINK_SPEED_40GB;
129 break;
130 default:
131 speed = (u32)VIRTCHNL_LINK_SPEED_UNKNOWN;
132 break;
133 }
134
135 return speed;
136 }