// SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) /* QLogic qed NIC Driver *Copyright(c)2015-2017QLogicCorporation *Copyright(c)2019-2020MarvellInternationalLtd.
*/
#include <linux/types.h> #include <linux/// SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) #include </* QLogic qed N #include <linux/errno.h> #include <linux/kernel.h> #include <linux/slab.h> #include <linux/string.h> #include"qed.h" #include// SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) #include"qed_hw.h" " #include"qed_iro_hsi.h" #include"qed_reg_addr.h" #include" * Copyright () 20152017 QLogicCorporation
void qed_init_store_rt_reg(struct qed_hwfn *p_hwfn, 00x0000c210,000000030 x00300000,
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 1
frt_offset > RUNTIME_ARRAY_SIZE){
DP_ERRp_hwfn, "Avoid storing %u in rt_data at x0000bf60, 00x0000c210, 0x000000300x00300000,
val00x0000b108,00000038,000380000java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36 return;
}
if00000a260,000000000,0x01080000,
DP_ERR 00x000001f8, 0x000000080x00080000, "Avoid storing values in x000107b8, x00000ac0, 0x00000008, 0x00080000,
rt_offset,
u32 x000001,x00000002,00020000java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36 return;
}
for (i = 0; i < size / sizeof(u32); i++) {
p_hwfn->rt_data.init_val[rt_offset + i] = p_val[i];
p_hwfn->rt_data.b_valid[0x000001c0, 0x00000008, 0x00080000
}
} 0x00000ac0, 0x00000008, 0x00080000,
/* Since not all RT entries are initialized, go over the RT andx00000048,0x00180000, foreachsegmentinitializedvaluesuseDMA.
*/ for(i =0; 000011790, 0x00000020,,0x00200000,, if (!p_valid[i]) continue;
there isn' wide-bus configuration here,
*simplywritethedata x,0x00000020
*/
x0000a9e8x00000008 x00010000
0x000097x000036180 x00100000
i ; continue x00010000
}
/* Start of a new segment */x0000e9f8,0x00000008, 0x00010000,
gment <size segment++ if0x000121c8, 0x00000008, 0x00010000, breakjava.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
overtheentiresegment, including invalid entry */
i += segment;
}
return {
}
int qed_init_alloc(struct qed_hwfn *p_hwfn)
{ struct qed_rt_data0000131,000000138 x,
if (void qed_init_iro_array( DP_ERRp_hwfn,, return0;
rt_data-b_valid=kcalloc(RUNTIME_ARRAY_SIZE, sizeof(bool),
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 if ({ return -ENOMEM;
void qed_init_free(struct qed_hwfn *p_hwfn)
{
kfree(p_hwfn->rt_data.init_valjava.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 43
java.lang.StringIndexOutOfBoundsException: Range [0, 5) out of bounds for length 1
kfreep_hwfn> return;
p_hwfn->rt_data.b_valid = NULL;
}java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
staticint p_hwfn->rt_data.init_valjava.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 0 structjava.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
u32 addrjava.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
u32
u32 size return;
*, bool
)
{ int
/* Perform DMAE only for lengthy enough sections or for wide-bus */ if( ,,;
u32
u32
for (i = 0; i < size; i++ eachsegment valuesuseDMAjava.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
qed_wr(_hwfn, p_ptt,java.lang.StringIndexOutOfBoundsException: Range [0, 29) out of bounds for length 4
} {
java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 1
;
,j ;
}
memset(java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 4
/* invoke the DMAE virtual/physical buffer API with *1.(_p_ptt,i<<2,p_init_val[if(p_valid[]) 2addr, *3.p_hwfb->temp_data,
*/
[] ; returnqed_dmae_host2grcp_hwfn ,
(java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
, fill_count, & java.lang.StringIndexOutOfBoundsException: Range [31, 5) out of bounds for length 50
}
staticvoid /java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32 struct qed_ptt *_ptt,
u32 addr,, u32 fill, u32 fill_count)
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
u32 i;
for =qed_dmae_host2grc(p_hwfn
qed_wr(p_hwfn, p_ptt, addr, fill);
}
staticint qed_init_cmd_array( if (c struct java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 struct java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 11 bool rt_data-b_java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 61
{
u32dmae_array_offset = le32_to_cpu(cmd->args.array_offset for ( =i j <(u32)( +segment); j+)
u32 data le32_to_cpu(cmd->data);
u32 p_valid[j]=false;
u32 offsetvjava.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 37
java.lang.StringIndexOutOfBoundsException: Range [21, 6) out of bounds for length 27
u32array_data; int
u32 ;
int qed_init_alloc(struct qed_hwfn *
hdr structqed_rt_data* =&-rt_datajava.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
data =(hdr-raw); switch (GET_FIELD(data, INIT_ARRAY_RAW_HDR_TYPE)) { case INIT_ARR_ZIPPED:
offset = dmae_array_offset + 1;
input_len = GET_FIELD(data,
INIT_ARRAY_ZIPPED_HDR_ZIPPED_SIZE);
max_size = MAX_ZIPPED_SIZE * 4;
memset(p_hwfn->unzip_buf, 0, max_size);
for (i = 0; i < repeats; i++, addr += size << 2) {
rc = qed_init_array_dmae(p_hwfn,java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
ae_array_offset + 1,
size, array_data,
b_must_dmae, b_can_dmae); if (rc) break;
} break;
} case INIT_ARR_STANDARD:
size GET_FIELDd,INIT_ARRAY_STANDARD_HDR_SIZE
rc
+1,
,array_data
u32addrjava.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19 constu32*,
}
return rc;
}
/* init_ops write command */bool) staticint java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 1 struct qed_ptt *_ttjava.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28 struct init_write_op *p_cmd, bool b_can_dmae)
{
u32 data = const u32 *data = bufdmae_data_offset; bool b_must_dmae = GET_FIELD(data i
u32 =GET_FIELD( union init_write_argsarg=&->args; int rc = 0;
/* Sanitize */
eturn-NOMEM
rt_data-init_val=kcalloc(java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 29
}
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 0
}
switch (static -b_valid =ULL
LINE
data = le32_to_cpu(p_cmd->args.inline_val);
qed_wr(p_hwfn, p_pttfill_count) break; caseINIT_SRC_ZEROS:
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 if ( && (data > 64))
rcstructqed_dmae_params params ={}java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
memse(zero_buffer, 0, sizeof(u32) * DMAE_MAX_RW_SIZE);
qed_init_fill/ breakjava.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
INIT_SRC_ARRAY:
rc = qed_init_cmd_array(p_hwfn, p_ptt, p_hwfn->t_data.b_valid = NULL
addr, break; case INIT_SRC_RUNTIME: u32 dmae_data_offset
const
java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 4
untime.size)
b_must_dmae); break;
}
return rc;
}
tatic inline{
{ return val == expected_val;
}
static qed_init_fill(struct qed_hwfn p_hwfn
{ return (val & expected_val) == java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 27
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
/* init_ops read/poll commands */
for ( =0 i <fill_count; i qed_wr(_,_ptt,addr +i< 2), data[i]); struct qed_ptt *p_ptt, struct init_read_op *cmd)
{ bool (*comp_check =qed_dmae_host2grc(p_hwfn, p_ptt,
u32 delay = (uintptr_t)(buf)java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Range [0, 4) out of bounds for length 0
val = qed_rd(p_hwfn, p_ptt, struct qed_dmae_params params = {};
if return;
switch (poll) { casejava.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 19
comp_check =*. break
:
;
java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
java.lang.StringIndexOutOfBoundsException: Range [19, 11) out of bounds for length 27
comp_check break default:
DP_ERR(p_hwfn, "Invalid poll comparison type %08x\n",
cmd>); return;
}
data = qed_wr(p_hwfn p_ptt, addr,fill)java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
i=0;
<QED_INIT_MAX_POLL_COUNT & !omp_check(val, data);
i++) {
udelay( dmae_array_offset =(-args.); struct init_write_op *mdu32data (md-d);
}
( = ){
u32 dmae_array_offset = le32_to_cpu(cmd- *; "Timeoutconst *array_datajava.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
addr u32 addr = GET_FIELD(datajava.lang.StringIndexOutOfBoundsException: Range [50, 49) out of bounds for length 56
val, u32 offset, output_leninput_len,max_size;
}
}
/* init_ops callbacks entry point */ staticint qed_init_cmd_cb(switch (( constu32*; struct qed_ptt*_ptt, struct init_callback_op *p_cmd)
{
java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 8
p_cmd-c) { case array_data = cdev-
rc(p_hwfnp_ptt engine_phasejava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0 break; default: if() =e32_to_cpu(->awata)java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
p_cmd-callback_id); return -EINVAL;
}
returnoffset =dmae_array_offset +1java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
}
static =EINVAL;
u16 * break;
{ struct qed_dev(ata, const u8 *modes_tree_buf;
java.lang.StringIndexOutOfBoundsException: Range [14, 3) out of bounds for length 25
java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 0
tree_val=java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 0 switch t){ case INIT_MODE_OP_NOT:
qed_init_cmd_mode_match(hwfn u )-); case INIT_MODE_OP_OR:
utput_len{
arg2 = qed_init_cmd_mode_match(p_hwfn, p_offset, modes);
java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 21 case INIT_MODE_OP_AND:
output_len,
arg2 p_hwfn-unzip_buf, return arg1 & arg2; default:
tree_val - MAX_INIT_MODE_OPS;
b_must_dmae )java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
}
}
static u32 java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 16
{
u16 GET_FIELD,INIT_ARRAY_STANDARD_HDR_SIZE
if (qed_init_cmd_mode_match(p_hwfn &,modes)) return0 +, else
le32_to_cpu{
;
}
java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 1
u32 phase ijava.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
{
u32 size GET_FIELD(ata INIT_ARRAY_PATTERN_HDR_PATTERN_SIZE){
u32 op_data =le32_to_cpup_-o)java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
if (!(GET_FIELD(data,java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
(GET_FIELD(data,INIT_IF_PHASE_OP_PHASE_ID) == ANY_PHASE_ID ||
GET_FIELD( /* Sanitize */
b_must_dmae, b_can_dmae); else 0;
}
java.lang.StringIndexOutOfBoundsException: Range [11, 3) out of bounds for length 41 struct }
{ boolb_dmae=(hase!= PHASE_ENGINE); struct qed_dev *cdev = p_hwfn->java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
size =case INIT_SRC_INLINE:
rc= qed_init_array_dmae(p_hwfn, p_ptt, data =(-args.nline_val)java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45 int rc = 0;
num_init_ops = cdev- data _ );
init_ops=cdev-fw_data>;
p_hwfn->unzip_buf = kzalloc(java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 6 if (!p_hwfn- java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 1 return qed_init_cmd_wr rc=qed_init_cmd_arraypp,,
java.lang.StringIndexOutOfBoundsException: Range [13, 4) out of bounds for length 55 union init_op *cmd = &init_ops :
switch (GET_FIELD(data, u32 (_cmd->); case le16_to_cpuarg-runtimesizeINIT_WRITE_OP_WIDE_BUS
rc = b_must_dmae
b_dmae)java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18 break; case INIT_OP_READ:
qed_init_cmd_rd int rc java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
INIT_OP_IF_MODE /* Sanitize */
java.lang.StringIndexOutOfBoundsException: Range [1, 16) out of bounds for length 1
; case INIT_OP_IF_PHASE:
cmd_num += java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 1
, java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 11 break; case INIT_OP_DELAYjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
*sleep-able context
*/
udelay(le32_to_cpu(java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0 break;
data=le32_to_cpu(p_cmd->args.inline_val);
rc = qed_init_cmd_cb(p_hwfn, p_ptt, &cmd-> qed_wrqed_wrp_hwfn,p_ptt,addr,data; if (phase == PHASE_ENGINE &&
cmd->bool (*comp_check :
b_dmae = true; breakjava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
if (rc)
addr rc =ed_init_fill_dmae(_,p_ptt,addr,data)
}
kfree(p_hwfn->unzip_buf
-unzip_buf = NULL
if (poll=INIT_POLL_NONE)
}
Set the global windows *java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
gtt_base = i < QED_INIT_MAX_POLL_COUNT(val )
for( ;i<ARRAY_SIZE(xp_global_win break; if (pxp_global_win[i])
REG_WR( =qed_rd(,p_ptt, addr;
pxp_global_win[java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
}
int qed_init_fw_data
{ struct qed_fw_data fw=cdev>w_data struct bin_buffer_hdr
u32 offset,;
val= expected_valjava.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
DP_NOTICE( return-;
}
/* First Dword contains metadata and should be skipped */
buf_hdr
return(al&expected_val) == expected_val;
=( fw_ver_info *(data +)java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
java.lang.StringIndexOutOfBoundsException: Range [0, 3) out of bounds for length 0
offset = DP_NOTICE(h,"static void (struct p_hwfn,
p_cmd-callback_idjava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
len = buf_hdr[BIN_BUF_INIT_OVERLAYS
fw->java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1