cxgb4: Remove preprocessor check for CONFIG_CXGB4_DCB
[deliverable/linux.git] / drivers / net / ethernet / chelsio / cxgb4 / cxgb4_debugfs.c
CommitLineData
fd88b31a
HS
1/*
2 * This file is part of the Chelsio T4 Ethernet driver for Linux.
3 *
4 * Copyright (c) 2003-2014 Chelsio Communications, Inc. All rights reserved.
5 *
6 * This software is available to you under a choice of one of two
7 * licenses. You may choose to be licensed under the terms of the GNU
8 * General Public License (GPL) Version 2, available from the file
9 * COPYING in the main directory of this source tree, or the
10 * OpenIB.org BSD license below:
11 *
12 * Redistribution and use in source and binary forms, with or
13 * without modification, are permitted provided that the following
14 * conditions are met:
15 *
16 * - Redistributions of source code must retain the above
17 * copyright notice, this list of conditions and the following
18 * disclaimer.
19 *
20 * - Redistributions in binary form must reproduce the above
21 * copyright notice, this list of conditions and the following
22 * disclaimer in the documentation and/or other materials
23 * provided with the distribution.
24 *
25 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
26 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
27 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
28 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
29 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
30 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
31 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
32 * SOFTWARE.
33 */
34
35#include <linux/seq_file.h>
36#include <linux/debugfs.h>
37#include <linux/string_helpers.h>
38#include <linux/sort.h>
688ea5fe 39#include <linux/ctype.h>
fd88b31a
HS
40
41#include "cxgb4.h"
42#include "t4_regs.h"
43#include "t4fw_api.h"
44#include "cxgb4_debugfs.h"
b5a02f50 45#include "clip_tbl.h"
fd88b31a
HS
46#include "l2t.h"
47
f1ff24aa
HS
48/* generic seq_file support for showing a table of size rows x width. */
49static void *seq_tab_get_idx(struct seq_tab *tb, loff_t pos)
50{
51 pos -= tb->skip_first;
52 return pos >= tb->rows ? NULL : &tb->data[pos * tb->width];
53}
54
55static void *seq_tab_start(struct seq_file *seq, loff_t *pos)
56{
57 struct seq_tab *tb = seq->private;
58
59 if (tb->skip_first && *pos == 0)
60 return SEQ_START_TOKEN;
61
62 return seq_tab_get_idx(tb, *pos);
63}
64
65static void *seq_tab_next(struct seq_file *seq, void *v, loff_t *pos)
66{
67 v = seq_tab_get_idx(seq->private, *pos + 1);
68 if (v)
69 ++*pos;
70 return v;
71}
72
73static void seq_tab_stop(struct seq_file *seq, void *v)
74{
75}
76
77static int seq_tab_show(struct seq_file *seq, void *v)
78{
79 const struct seq_tab *tb = seq->private;
80
81 return tb->show(seq, v, ((char *)v - tb->data) / tb->width);
82}
83
84static const struct seq_operations seq_tab_ops = {
85 .start = seq_tab_start,
86 .next = seq_tab_next,
87 .stop = seq_tab_stop,
88 .show = seq_tab_show
89};
90
91struct seq_tab *seq_open_tab(struct file *f, unsigned int rows,
92 unsigned int width, unsigned int have_header,
93 int (*show)(struct seq_file *seq, void *v, int i))
94{
95 struct seq_tab *p;
96
97 p = __seq_open_private(f, &seq_tab_ops, sizeof(*p) + rows * width);
98 if (p) {
99 p->show = show;
100 p->rows = rows;
101 p->width = width;
102 p->skip_first = have_header != 0;
103 }
104 return p;
105}
106
c778af7d
HS
107/* Trim the size of a seq_tab to the supplied number of rows. The operation is
108 * irreversible.
109 */
110static int seq_tab_trim(struct seq_tab *p, unsigned int new_rows)
111{
112 if (new_rows > p->rows)
113 return -EINVAL;
114 p->rows = new_rows;
115 return 0;
116}
117
f1ff24aa
HS
118static int cim_la_show(struct seq_file *seq, void *v, int idx)
119{
120 if (v == SEQ_START_TOKEN)
121 seq_puts(seq, "Status Data PC LS0Stat LS0Addr "
122 " LS0Data\n");
123 else {
124 const u32 *p = v;
125
126 seq_printf(seq,
127 " %02x %x%07x %x%07x %08x %08x %08x%08x%08x%08x\n",
128 (p[0] >> 4) & 0xff, p[0] & 0xf, p[1] >> 4,
129 p[1] & 0xf, p[2] >> 4, p[2] & 0xf, p[3], p[4], p[5],
130 p[6], p[7]);
131 }
132 return 0;
133}
134
135static int cim_la_show_3in1(struct seq_file *seq, void *v, int idx)
136{
137 if (v == SEQ_START_TOKEN) {
138 seq_puts(seq, "Status Data PC\n");
139 } else {
140 const u32 *p = v;
141
142 seq_printf(seq, " %02x %08x %08x\n", p[5] & 0xff, p[6],
143 p[7]);
144 seq_printf(seq, " %02x %02x%06x %02x%06x\n",
145 (p[3] >> 8) & 0xff, p[3] & 0xff, p[4] >> 8,
146 p[4] & 0xff, p[5] >> 8);
147 seq_printf(seq, " %02x %x%07x %x%07x\n", (p[0] >> 4) & 0xff,
148 p[0] & 0xf, p[1] >> 4, p[1] & 0xf, p[2] >> 4);
149 }
150 return 0;
151}
152
153static int cim_la_open(struct inode *inode, struct file *file)
154{
155 int ret;
156 unsigned int cfg;
157 struct seq_tab *p;
158 struct adapter *adap = inode->i_private;
159
160 ret = t4_cim_read(adap, UP_UP_DBG_LA_CFG_A, 1, &cfg);
161 if (ret)
162 return ret;
163
164 p = seq_open_tab(file, adap->params.cim_la_size / 8, 8 * sizeof(u32), 1,
165 cfg & UPDBGLACAPTPCONLY_F ?
166 cim_la_show_3in1 : cim_la_show);
167 if (!p)
168 return -ENOMEM;
169
170 ret = t4_cim_read_la(adap, (u32 *)p->data, NULL);
171 if (ret)
172 seq_release_private(inode, file);
173 return ret;
174}
175
176static const struct file_operations cim_la_fops = {
177 .owner = THIS_MODULE,
178 .open = cim_la_open,
179 .read = seq_read,
180 .llseek = seq_lseek,
181 .release = seq_release_private
182};
183
74b3092c
HS
184static int cim_qcfg_show(struct seq_file *seq, void *v)
185{
186 static const char * const qname[] = {
187 "TP0", "TP1", "ULP", "SGE0", "SGE1", "NC-SI",
188 "ULP0", "ULP1", "ULP2", "ULP3", "SGE", "NC-SI",
189 "SGE0-RX", "SGE1-RX"
190 };
191
192 int i;
193 struct adapter *adap = seq->private;
194 u16 base[CIM_NUM_IBQ + CIM_NUM_OBQ_T5];
195 u16 size[CIM_NUM_IBQ + CIM_NUM_OBQ_T5];
196 u32 stat[(4 * (CIM_NUM_IBQ + CIM_NUM_OBQ_T5))];
197 u16 thres[CIM_NUM_IBQ];
198 u32 obq_wr_t4[2 * CIM_NUM_OBQ], *wr;
199 u32 obq_wr_t5[2 * CIM_NUM_OBQ_T5];
200 u32 *p = stat;
201 int cim_num_obq = is_t4(adap->params.chip) ?
202 CIM_NUM_OBQ : CIM_NUM_OBQ_T5;
203
204 i = t4_cim_read(adap, is_t4(adap->params.chip) ? UP_IBQ_0_RDADDR_A :
205 UP_IBQ_0_SHADOW_RDADDR_A,
206 ARRAY_SIZE(stat), stat);
207 if (!i) {
208 if (is_t4(adap->params.chip)) {
209 i = t4_cim_read(adap, UP_OBQ_0_REALADDR_A,
210 ARRAY_SIZE(obq_wr_t4), obq_wr_t4);
211 wr = obq_wr_t4;
212 } else {
213 i = t4_cim_read(adap, UP_OBQ_0_SHADOW_REALADDR_A,
214 ARRAY_SIZE(obq_wr_t5), obq_wr_t5);
215 wr = obq_wr_t5;
216 }
217 }
218 if (i)
219 return i;
220
221 t4_read_cimq_cfg(adap, base, size, thres);
222
223 seq_printf(seq,
224 " Queue Base Size Thres RdPtr WrPtr SOP EOP Avail\n");
225 for (i = 0; i < CIM_NUM_IBQ; i++, p += 4)
226 seq_printf(seq, "%7s %5x %5u %5u %6x %4x %4u %4u %5u\n",
227 qname[i], base[i], size[i], thres[i],
228 IBQRDADDR_G(p[0]), IBQWRADDR_G(p[1]),
229 QUESOPCNT_G(p[3]), QUEEOPCNT_G(p[3]),
230 QUEREMFLITS_G(p[2]) * 16);
231 for ( ; i < CIM_NUM_IBQ + cim_num_obq; i++, p += 4, wr += 2)
232 seq_printf(seq, "%7s %5x %5u %12x %4x %4u %4u %5u\n",
233 qname[i], base[i], size[i],
234 QUERDADDR_G(p[0]) & 0x3fff, wr[0] - base[i],
235 QUESOPCNT_G(p[3]), QUEEOPCNT_G(p[3]),
236 QUEREMFLITS_G(p[2]) * 16);
237 return 0;
238}
239
240static int cim_qcfg_open(struct inode *inode, struct file *file)
241{
242 return single_open(file, cim_qcfg_show, inode->i_private);
243}
244
245static const struct file_operations cim_qcfg_fops = {
246 .owner = THIS_MODULE,
247 .open = cim_qcfg_open,
248 .read = seq_read,
249 .llseek = seq_lseek,
250 .release = single_release,
251};
252
e5f0e43b
HS
253static int cimq_show(struct seq_file *seq, void *v, int idx)
254{
255 const u32 *p = v;
256
257 seq_printf(seq, "%#06x: %08x %08x %08x %08x\n", idx * 16, p[0], p[1],
258 p[2], p[3]);
259 return 0;
260}
261
262static int cim_ibq_open(struct inode *inode, struct file *file)
263{
264 int ret;
265 struct seq_tab *p;
266 unsigned int qid = (uintptr_t)inode->i_private & 7;
267 struct adapter *adap = inode->i_private - qid;
268
269 p = seq_open_tab(file, CIM_IBQ_SIZE, 4 * sizeof(u32), 0, cimq_show);
270 if (!p)
271 return -ENOMEM;
272
273 ret = t4_read_cim_ibq(adap, qid, (u32 *)p->data, CIM_IBQ_SIZE * 4);
274 if (ret < 0)
275 seq_release_private(inode, file);
276 else
277 ret = 0;
278 return ret;
279}
280
281static const struct file_operations cim_ibq_fops = {
282 .owner = THIS_MODULE,
283 .open = cim_ibq_open,
284 .read = seq_read,
285 .llseek = seq_lseek,
286 .release = seq_release_private
287};
288
c778af7d
HS
289static int cim_obq_open(struct inode *inode, struct file *file)
290{
291 int ret;
292 struct seq_tab *p;
293 unsigned int qid = (uintptr_t)inode->i_private & 7;
294 struct adapter *adap = inode->i_private - qid;
295
296 p = seq_open_tab(file, 6 * CIM_OBQ_SIZE, 4 * sizeof(u32), 0, cimq_show);
297 if (!p)
298 return -ENOMEM;
299
300 ret = t4_read_cim_obq(adap, qid, (u32 *)p->data, 6 * CIM_OBQ_SIZE * 4);
301 if (ret < 0) {
302 seq_release_private(inode, file);
303 } else {
304 seq_tab_trim(p, ret / 4);
305 ret = 0;
306 }
307 return ret;
308}
309
310static const struct file_operations cim_obq_fops = {
311 .owner = THIS_MODULE,
312 .open = cim_obq_open,
313 .read = seq_read,
314 .llseek = seq_lseek,
315 .release = seq_release_private
316};
317
b3bbe36a
HS
318/* Show the PM memory stats. These stats include:
319 *
320 * TX:
321 * Read: memory read operation
322 * Write Bypass: cut-through
323 * Bypass + mem: cut-through and save copy
324 *
325 * RX:
326 * Read: memory read
327 * Write Bypass: cut-through
328 * Flush: payload trim or drop
329 */
330static int pm_stats_show(struct seq_file *seq, void *v)
331{
332 static const char * const tx_pm_stats[] = {
333 "Read:", "Write bypass:", "Write mem:", "Bypass + mem:"
334 };
335 static const char * const rx_pm_stats[] = {
336 "Read:", "Write bypass:", "Write mem:", "Flush:"
337 };
338
339 int i;
340 u32 tx_cnt[PM_NSTATS], rx_cnt[PM_NSTATS];
341 u64 tx_cyc[PM_NSTATS], rx_cyc[PM_NSTATS];
342 struct adapter *adap = seq->private;
343
344 t4_pmtx_get_stats(adap, tx_cnt, tx_cyc);
345 t4_pmrx_get_stats(adap, rx_cnt, rx_cyc);
346
347 seq_printf(seq, "%13s %10s %20s\n", " ", "Tx pcmds", "Tx bytes");
348 for (i = 0; i < PM_NSTATS - 1; i++)
349 seq_printf(seq, "%-13s %10u %20llu\n",
350 tx_pm_stats[i], tx_cnt[i], tx_cyc[i]);
351
352 seq_printf(seq, "%13s %10s %20s\n", " ", "Rx pcmds", "Rx bytes");
353 for (i = 0; i < PM_NSTATS - 1; i++)
354 seq_printf(seq, "%-13s %10u %20llu\n",
355 rx_pm_stats[i], rx_cnt[i], rx_cyc[i]);
356 return 0;
357}
358
359static int pm_stats_open(struct inode *inode, struct file *file)
360{
361 return single_open(file, pm_stats_show, inode->i_private);
362}
363
364static ssize_t pm_stats_clear(struct file *file, const char __user *buf,
365 size_t count, loff_t *pos)
366{
367 struct adapter *adap = FILE_DATA(file)->i_private;
368
369 t4_write_reg(adap, PM_RX_STAT_CONFIG_A, 0);
370 t4_write_reg(adap, PM_TX_STAT_CONFIG_A, 0);
371 return count;
372}
373
374static const struct file_operations pm_stats_debugfs_fops = {
375 .owner = THIS_MODULE,
376 .open = pm_stats_open,
377 .read = seq_read,
378 .llseek = seq_lseek,
379 .release = single_release,
380 .write = pm_stats_clear
381};
382
b58b6676
HS
383/* Format a value in a unit that differs from the value's native unit by the
384 * given factor.
385 */
386static char *unit_conv(char *buf, size_t len, unsigned int val,
387 unsigned int factor)
388{
389 unsigned int rem = val % factor;
390
391 if (rem == 0) {
392 snprintf(buf, len, "%u", val / factor);
393 } else {
394 while (rem % 10 == 0)
395 rem /= 10;
396 snprintf(buf, len, "%u.%u", val / factor, rem);
397 }
398 return buf;
399}
400
401static int clk_show(struct seq_file *seq, void *v)
402{
403 char buf[32];
404 struct adapter *adap = seq->private;
405 unsigned int cclk_ps = 1000000000 / adap->params.vpd.cclk; /* in ps */
406 u32 res = t4_read_reg(adap, TP_TIMER_RESOLUTION_A);
407 unsigned int tre = TIMERRESOLUTION_G(res);
408 unsigned int dack_re = DELAYEDACKRESOLUTION_G(res);
409 unsigned long long tp_tick_us = (cclk_ps << tre) / 1000000; /* in us */
410
411 seq_printf(seq, "Core clock period: %s ns\n",
412 unit_conv(buf, sizeof(buf), cclk_ps, 1000));
413 seq_printf(seq, "TP timer tick: %s us\n",
414 unit_conv(buf, sizeof(buf), (cclk_ps << tre), 1000000));
415 seq_printf(seq, "TCP timestamp tick: %s us\n",
416 unit_conv(buf, sizeof(buf),
417 (cclk_ps << TIMESTAMPRESOLUTION_G(res)), 1000000));
418 seq_printf(seq, "DACK tick: %s us\n",
419 unit_conv(buf, sizeof(buf), (cclk_ps << dack_re), 1000000));
420 seq_printf(seq, "DACK timer: %u us\n",
421 ((cclk_ps << dack_re) / 1000000) *
422 t4_read_reg(adap, TP_DACK_TIMER_A));
423 seq_printf(seq, "Retransmit min: %llu us\n",
424 tp_tick_us * t4_read_reg(adap, TP_RXT_MIN_A));
425 seq_printf(seq, "Retransmit max: %llu us\n",
426 tp_tick_us * t4_read_reg(adap, TP_RXT_MAX_A));
427 seq_printf(seq, "Persist timer min: %llu us\n",
428 tp_tick_us * t4_read_reg(adap, TP_PERS_MIN_A));
429 seq_printf(seq, "Persist timer max: %llu us\n",
430 tp_tick_us * t4_read_reg(adap, TP_PERS_MAX_A));
431 seq_printf(seq, "Keepalive idle timer: %llu us\n",
432 tp_tick_us * t4_read_reg(adap, TP_KEEP_IDLE_A));
433 seq_printf(seq, "Keepalive interval: %llu us\n",
434 tp_tick_us * t4_read_reg(adap, TP_KEEP_INTVL_A));
435 seq_printf(seq, "Initial SRTT: %llu us\n",
436 tp_tick_us * INITSRTT_G(t4_read_reg(adap, TP_INIT_SRTT_A)));
437 seq_printf(seq, "FINWAIT2 timer: %llu us\n",
438 tp_tick_us * t4_read_reg(adap, TP_FINWAIT2_TIMER_A));
439
440 return 0;
441}
442
443DEFINE_SIMPLE_DEBUGFS_FILE(clk);
444
f1ff24aa 445/* Firmware Device Log dump. */
49aa284f
HS
446static const char * const devlog_level_strings[] = {
447 [FW_DEVLOG_LEVEL_EMERG] = "EMERG",
448 [FW_DEVLOG_LEVEL_CRIT] = "CRIT",
449 [FW_DEVLOG_LEVEL_ERR] = "ERR",
450 [FW_DEVLOG_LEVEL_NOTICE] = "NOTICE",
451 [FW_DEVLOG_LEVEL_INFO] = "INFO",
452 [FW_DEVLOG_LEVEL_DEBUG] = "DEBUG"
453};
454
455static const char * const devlog_facility_strings[] = {
456 [FW_DEVLOG_FACILITY_CORE] = "CORE",
457 [FW_DEVLOG_FACILITY_SCHED] = "SCHED",
458 [FW_DEVLOG_FACILITY_TIMER] = "TIMER",
459 [FW_DEVLOG_FACILITY_RES] = "RES",
460 [FW_DEVLOG_FACILITY_HW] = "HW",
461 [FW_DEVLOG_FACILITY_FLR] = "FLR",
462 [FW_DEVLOG_FACILITY_DMAQ] = "DMAQ",
463 [FW_DEVLOG_FACILITY_PHY] = "PHY",
464 [FW_DEVLOG_FACILITY_MAC] = "MAC",
465 [FW_DEVLOG_FACILITY_PORT] = "PORT",
466 [FW_DEVLOG_FACILITY_VI] = "VI",
467 [FW_DEVLOG_FACILITY_FILTER] = "FILTER",
468 [FW_DEVLOG_FACILITY_ACL] = "ACL",
469 [FW_DEVLOG_FACILITY_TM] = "TM",
470 [FW_DEVLOG_FACILITY_QFC] = "QFC",
471 [FW_DEVLOG_FACILITY_DCB] = "DCB",
472 [FW_DEVLOG_FACILITY_ETH] = "ETH",
473 [FW_DEVLOG_FACILITY_OFLD] = "OFLD",
474 [FW_DEVLOG_FACILITY_RI] = "RI",
475 [FW_DEVLOG_FACILITY_ISCSI] = "ISCSI",
476 [FW_DEVLOG_FACILITY_FCOE] = "FCOE",
477 [FW_DEVLOG_FACILITY_FOISCSI] = "FOISCSI",
478 [FW_DEVLOG_FACILITY_FOFCOE] = "FOFCOE"
479};
480
481/* Information gathered by Device Log Open routine for the display routine.
482 */
483struct devlog_info {
484 unsigned int nentries; /* number of entries in log[] */
485 unsigned int first; /* first [temporal] entry in log[] */
486 struct fw_devlog_e log[0]; /* Firmware Device Log */
487};
488
489/* Dump a Firmaware Device Log entry.
490 */
491static int devlog_show(struct seq_file *seq, void *v)
492{
493 if (v == SEQ_START_TOKEN)
494 seq_printf(seq, "%10s %15s %8s %8s %s\n",
495 "Seq#", "Tstamp", "Level", "Facility", "Message");
496 else {
497 struct devlog_info *dinfo = seq->private;
498 int fidx = (uintptr_t)v - 2;
499 unsigned long index;
500 struct fw_devlog_e *e;
501
502 /* Get a pointer to the log entry to display. Skip unused log
503 * entries.
504 */
505 index = dinfo->first + fidx;
506 if (index >= dinfo->nentries)
507 index -= dinfo->nentries;
508 e = &dinfo->log[index];
509 if (e->timestamp == 0)
510 return 0;
511
512 /* Print the message. This depends on the firmware using
513 * exactly the same formating strings as the kernel so we may
514 * eventually have to put a format interpreter in here ...
515 */
516 seq_printf(seq, "%10d %15llu %8s %8s ",
517 e->seqno, e->timestamp,
518 (e->level < ARRAY_SIZE(devlog_level_strings)
519 ? devlog_level_strings[e->level]
520 : "UNKNOWN"),
521 (e->facility < ARRAY_SIZE(devlog_facility_strings)
522 ? devlog_facility_strings[e->facility]
523 : "UNKNOWN"));
524 seq_printf(seq, e->fmt, e->params[0], e->params[1],
525 e->params[2], e->params[3], e->params[4],
526 e->params[5], e->params[6], e->params[7]);
527 }
528 return 0;
529}
530
531/* Sequential File Operations for Device Log.
532 */
533static inline void *devlog_get_idx(struct devlog_info *dinfo, loff_t pos)
534{
535 if (pos > dinfo->nentries)
536 return NULL;
537
538 return (void *)(uintptr_t)(pos + 1);
539}
540
541static void *devlog_start(struct seq_file *seq, loff_t *pos)
542{
543 struct devlog_info *dinfo = seq->private;
544
545 return (*pos
546 ? devlog_get_idx(dinfo, *pos)
547 : SEQ_START_TOKEN);
548}
549
550static void *devlog_next(struct seq_file *seq, void *v, loff_t *pos)
551{
552 struct devlog_info *dinfo = seq->private;
553
554 (*pos)++;
555 return devlog_get_idx(dinfo, *pos);
556}
557
558static void devlog_stop(struct seq_file *seq, void *v)
559{
560}
561
562static const struct seq_operations devlog_seq_ops = {
563 .start = devlog_start,
564 .next = devlog_next,
565 .stop = devlog_stop,
566 .show = devlog_show
567};
568
569/* Set up for reading the firmware's device log. We read the entire log here
570 * and then display it incrementally in devlog_show().
571 */
572static int devlog_open(struct inode *inode, struct file *file)
573{
574 struct adapter *adap = inode->i_private;
575 struct devlog_params *dparams = &adap->params.devlog;
576 struct devlog_info *dinfo;
577 unsigned int index;
578 u32 fseqno;
579 int ret;
580
581 /* If we don't know where the log is we can't do anything.
582 */
583 if (dparams->start == 0)
584 return -ENXIO;
585
586 /* Allocate the space to read in the firmware's device log and set up
587 * for the iterated call to our display function.
588 */
589 dinfo = __seq_open_private(file, &devlog_seq_ops,
590 sizeof(*dinfo) + dparams->size);
591 if (!dinfo)
592 return -ENOMEM;
593
594 /* Record the basic log buffer information and read in the raw log.
595 */
596 dinfo->nentries = (dparams->size / sizeof(struct fw_devlog_e));
597 dinfo->first = 0;
598 spin_lock(&adap->win0_lock);
599 ret = t4_memory_rw(adap, adap->params.drv_memwin, dparams->memtype,
600 dparams->start, dparams->size, (__be32 *)dinfo->log,
601 T4_MEMORY_READ);
602 spin_unlock(&adap->win0_lock);
603 if (ret) {
604 seq_release_private(inode, file);
605 return ret;
606 }
607
608 /* Translate log multi-byte integral elements into host native format
609 * and determine where the first entry in the log is.
610 */
611 for (fseqno = ~((u32)0), index = 0; index < dinfo->nentries; index++) {
612 struct fw_devlog_e *e = &dinfo->log[index];
613 int i;
614 __u32 seqno;
615
616 if (e->timestamp == 0)
617 continue;
618
619 e->timestamp = (__force __be64)be64_to_cpu(e->timestamp);
620 seqno = be32_to_cpu(e->seqno);
621 for (i = 0; i < 8; i++)
622 e->params[i] =
623 (__force __be32)be32_to_cpu(e->params[i]);
624
625 if (seqno < fseqno) {
626 fseqno = seqno;
627 dinfo->first = index;
628 }
629 }
630 return 0;
631}
632
633static const struct file_operations devlog_fops = {
634 .owner = THIS_MODULE,
635 .open = devlog_open,
636 .read = seq_read,
637 .llseek = seq_lseek,
638 .release = seq_release_private
639};
640
49216c1c
HS
641static ssize_t flash_read(struct file *file, char __user *buf, size_t count,
642 loff_t *ppos)
643{
644 loff_t pos = *ppos;
645 loff_t avail = FILE_DATA(file)->i_size;
646 struct adapter *adap = file->private_data;
647
648 if (pos < 0)
649 return -EINVAL;
650 if (pos >= avail)
651 return 0;
652 if (count > avail - pos)
653 count = avail - pos;
654
655 while (count) {
656 size_t len;
657 int ret, ofst;
658 u8 data[256];
659
660 ofst = pos & 3;
661 len = min(count + ofst, sizeof(data));
662 ret = t4_read_flash(adap, pos - ofst, (len + 3) / 4,
663 (u32 *)data, 1);
664 if (ret)
665 return ret;
666
667 len -= ofst;
668 if (copy_to_user(buf, data + ofst, len))
669 return -EFAULT;
670
671 buf += len;
672 pos += len;
673 count -= len;
674 }
675 count = pos - *ppos;
676 *ppos = pos;
677 return count;
678}
679
680static const struct file_operations flash_debugfs_fops = {
681 .owner = THIS_MODULE,
682 .open = mem_open,
683 .read = flash_read,
684};
685
ef82f662
HS
686static inline void tcamxy2valmask(u64 x, u64 y, u8 *addr, u64 *mask)
687{
688 *mask = x | y;
689 y = (__force u64)cpu_to_be64(y);
690 memcpy(addr, (char *)&y + 2, ETH_ALEN);
691}
692
693static int mps_tcam_show(struct seq_file *seq, void *v)
694{
695 if (v == SEQ_START_TOKEN)
696 seq_puts(seq, "Idx Ethernet address Mask Vld Ports PF"
697 " VF Replication "
698 "P0 P1 P2 P3 ML\n");
699 else {
700 u64 mask;
701 u8 addr[ETH_ALEN];
702 struct adapter *adap = seq->private;
703 unsigned int idx = (uintptr_t)v - 2;
704 u64 tcamy = t4_read_reg64(adap, MPS_CLS_TCAM_Y_L(idx));
705 u64 tcamx = t4_read_reg64(adap, MPS_CLS_TCAM_X_L(idx));
706 u32 cls_lo = t4_read_reg(adap, MPS_CLS_SRAM_L(idx));
707 u32 cls_hi = t4_read_reg(adap, MPS_CLS_SRAM_H(idx));
708 u32 rplc[4] = {0, 0, 0, 0};
709
710 if (tcamx & tcamy) {
711 seq_printf(seq, "%3u -\n", idx);
712 goto out;
713 }
714
715 if (cls_lo & REPLICATE_F) {
716 struct fw_ldst_cmd ldst_cmd;
717 int ret;
718
719 memset(&ldst_cmd, 0, sizeof(ldst_cmd));
720 ldst_cmd.op_to_addrspace =
721 htonl(FW_CMD_OP_V(FW_LDST_CMD) |
722 FW_CMD_REQUEST_F |
723 FW_CMD_READ_F |
724 FW_LDST_CMD_ADDRSPACE_V(
725 FW_LDST_ADDRSPC_MPS));
726 ldst_cmd.cycles_to_len16 = htonl(FW_LEN16(ldst_cmd));
727 ldst_cmd.u.mps.fid_ctl =
728 htons(FW_LDST_CMD_FID_V(FW_LDST_MPS_RPLC) |
729 FW_LDST_CMD_CTL_V(idx));
730 ret = t4_wr_mbox(adap, adap->mbox, &ldst_cmd,
731 sizeof(ldst_cmd), &ldst_cmd);
732 if (ret)
733 dev_warn(adap->pdev_dev, "Can't read MPS "
734 "replication map for idx %d: %d\n",
735 idx, -ret);
736 else {
737 rplc[0] = ntohl(ldst_cmd.u.mps.rplc31_0);
738 rplc[1] = ntohl(ldst_cmd.u.mps.rplc63_32);
739 rplc[2] = ntohl(ldst_cmd.u.mps.rplc95_64);
740 rplc[3] = ntohl(ldst_cmd.u.mps.rplc127_96);
741 }
742 }
743
744 tcamxy2valmask(tcamx, tcamy, addr, &mask);
745 seq_printf(seq, "%3u %02x:%02x:%02x:%02x:%02x:%02x %012llx"
746 "%3c %#x%4u%4d",
747 idx, addr[0], addr[1], addr[2], addr[3], addr[4],
748 addr[5], (unsigned long long)mask,
749 (cls_lo & SRAM_VLD_F) ? 'Y' : 'N', PORTMAP_G(cls_hi),
750 PF_G(cls_lo),
751 (cls_lo & VF_VALID_F) ? VF_G(cls_lo) : -1);
752 if (cls_lo & REPLICATE_F)
753 seq_printf(seq, " %08x %08x %08x %08x",
754 rplc[3], rplc[2], rplc[1], rplc[0]);
755 else
756 seq_printf(seq, "%36c", ' ');
757 seq_printf(seq, "%4u%3u%3u%3u %#x\n",
758 SRAM_PRIO0_G(cls_lo), SRAM_PRIO1_G(cls_lo),
759 SRAM_PRIO2_G(cls_lo), SRAM_PRIO3_G(cls_lo),
760 (cls_lo >> MULTILISTEN0_S) & 0xf);
761 }
762out: return 0;
763}
764
765static inline void *mps_tcam_get_idx(struct seq_file *seq, loff_t pos)
766{
767 struct adapter *adap = seq->private;
768 int max_mac_addr = is_t4(adap->params.chip) ?
769 NUM_MPS_CLS_SRAM_L_INSTANCES :
770 NUM_MPS_T5_CLS_SRAM_L_INSTANCES;
771 return ((pos <= max_mac_addr) ? (void *)(uintptr_t)(pos + 1) : NULL);
772}
773
774static void *mps_tcam_start(struct seq_file *seq, loff_t *pos)
775{
776 return *pos ? mps_tcam_get_idx(seq, *pos) : SEQ_START_TOKEN;
777}
778
779static void *mps_tcam_next(struct seq_file *seq, void *v, loff_t *pos)
780{
781 ++*pos;
782 return mps_tcam_get_idx(seq, *pos);
783}
784
785static void mps_tcam_stop(struct seq_file *seq, void *v)
786{
787}
788
789static const struct seq_operations mps_tcam_seq_ops = {
790 .start = mps_tcam_start,
791 .next = mps_tcam_next,
792 .stop = mps_tcam_stop,
793 .show = mps_tcam_show
794};
795
796static int mps_tcam_open(struct inode *inode, struct file *file)
797{
798 int res = seq_open(file, &mps_tcam_seq_ops);
799
800 if (!res) {
801 struct seq_file *seq = file->private_data;
802
803 seq->private = inode->i_private;
804 }
805 return res;
806}
807
808static const struct file_operations mps_tcam_debugfs_fops = {
809 .owner = THIS_MODULE,
810 .open = mps_tcam_open,
811 .read = seq_read,
812 .llseek = seq_lseek,
813 .release = seq_release,
814};
815
b5a02f50
AB
816#if IS_ENABLED(CONFIG_IPV6)
817static int clip_tbl_open(struct inode *inode, struct file *file)
818{
819 return single_open(file, clip_tbl_show, PDE_DATA(inode));
820}
821
822static const struct file_operations clip_tbl_debugfs_fops = {
823 .owner = THIS_MODULE,
824 .open = clip_tbl_open,
825 .read = seq_read,
826 .llseek = seq_lseek,
827 .release = single_release
828};
829#endif
830
688ea5fe
HS
831/*RSS Table.
832 */
833
834static int rss_show(struct seq_file *seq, void *v, int idx)
835{
836 u16 *entry = v;
837
838 seq_printf(seq, "%4d: %4u %4u %4u %4u %4u %4u %4u %4u\n",
839 idx * 8, entry[0], entry[1], entry[2], entry[3], entry[4],
840 entry[5], entry[6], entry[7]);
841 return 0;
842}
843
844static int rss_open(struct inode *inode, struct file *file)
845{
846 int ret;
847 struct seq_tab *p;
848 struct adapter *adap = inode->i_private;
849
850 p = seq_open_tab(file, RSS_NENTRIES / 8, 8 * sizeof(u16), 0, rss_show);
851 if (!p)
852 return -ENOMEM;
853
854 ret = t4_read_rss(adap, (u16 *)p->data);
855 if (ret)
856 seq_release_private(inode, file);
857
858 return ret;
859}
860
861static const struct file_operations rss_debugfs_fops = {
862 .owner = THIS_MODULE,
863 .open = rss_open,
864 .read = seq_read,
865 .llseek = seq_lseek,
866 .release = seq_release_private
867};
868
869/* RSS Configuration.
870 */
871
872/* Small utility function to return the strings "yes" or "no" if the supplied
873 * argument is non-zero.
874 */
875static const char *yesno(int x)
876{
877 static const char *yes = "yes";
878 static const char *no = "no";
879
880 return x ? yes : no;
881}
882
883static int rss_config_show(struct seq_file *seq, void *v)
884{
885 struct adapter *adapter = seq->private;
886 static const char * const keymode[] = {
887 "global",
888 "global and per-VF scramble",
889 "per-PF and per-VF scramble",
890 "per-VF and per-VF scramble",
891 };
892 u32 rssconf;
893
894 rssconf = t4_read_reg(adapter, TP_RSS_CONFIG_A);
895 seq_printf(seq, "TP_RSS_CONFIG: %#x\n", rssconf);
896 seq_printf(seq, " Tnl4TupEnIpv6: %3s\n", yesno(rssconf &
897 TNL4TUPENIPV6_F));
898 seq_printf(seq, " Tnl2TupEnIpv6: %3s\n", yesno(rssconf &
899 TNL2TUPENIPV6_F));
900 seq_printf(seq, " Tnl4TupEnIpv4: %3s\n", yesno(rssconf &
901 TNL4TUPENIPV4_F));
902 seq_printf(seq, " Tnl2TupEnIpv4: %3s\n", yesno(rssconf &
903 TNL2TUPENIPV4_F));
904 seq_printf(seq, " TnlTcpSel: %3s\n", yesno(rssconf & TNLTCPSEL_F));
905 seq_printf(seq, " TnlIp6Sel: %3s\n", yesno(rssconf & TNLIP6SEL_F));
906 seq_printf(seq, " TnlVrtSel: %3s\n", yesno(rssconf & TNLVRTSEL_F));
907 seq_printf(seq, " TnlMapEn: %3s\n", yesno(rssconf & TNLMAPEN_F));
908 seq_printf(seq, " OfdHashSave: %3s\n", yesno(rssconf &
909 OFDHASHSAVE_F));
910 seq_printf(seq, " OfdVrtSel: %3s\n", yesno(rssconf & OFDVRTSEL_F));
911 seq_printf(seq, " OfdMapEn: %3s\n", yesno(rssconf & OFDMAPEN_F));
912 seq_printf(seq, " OfdLkpEn: %3s\n", yesno(rssconf & OFDLKPEN_F));
913 seq_printf(seq, " Syn4TupEnIpv6: %3s\n", yesno(rssconf &
914 SYN4TUPENIPV6_F));
915 seq_printf(seq, " Syn2TupEnIpv6: %3s\n", yesno(rssconf &
916 SYN2TUPENIPV6_F));
917 seq_printf(seq, " Syn4TupEnIpv4: %3s\n", yesno(rssconf &
918 SYN4TUPENIPV4_F));
919 seq_printf(seq, " Syn2TupEnIpv4: %3s\n", yesno(rssconf &
920 SYN2TUPENIPV4_F));
921 seq_printf(seq, " Syn4TupEnIpv6: %3s\n", yesno(rssconf &
922 SYN4TUPENIPV6_F));
923 seq_printf(seq, " SynIp6Sel: %3s\n", yesno(rssconf & SYNIP6SEL_F));
924 seq_printf(seq, " SynVrt6Sel: %3s\n", yesno(rssconf & SYNVRTSEL_F));
925 seq_printf(seq, " SynMapEn: %3s\n", yesno(rssconf & SYNMAPEN_F));
926 seq_printf(seq, " SynLkpEn: %3s\n", yesno(rssconf & SYNLKPEN_F));
927 seq_printf(seq, " ChnEn: %3s\n", yesno(rssconf &
928 CHANNELENABLE_F));
929 seq_printf(seq, " PrtEn: %3s\n", yesno(rssconf &
930 PORTENABLE_F));
931 seq_printf(seq, " TnlAllLkp: %3s\n", yesno(rssconf &
932 TNLALLLOOKUP_F));
933 seq_printf(seq, " VrtEn: %3s\n", yesno(rssconf &
934 VIRTENABLE_F));
935 seq_printf(seq, " CngEn: %3s\n", yesno(rssconf &
936 CONGESTIONENABLE_F));
937 seq_printf(seq, " HashToeplitz: %3s\n", yesno(rssconf &
938 HASHTOEPLITZ_F));
939 seq_printf(seq, " Udp4En: %3s\n", yesno(rssconf & UDPENABLE_F));
940 seq_printf(seq, " Disable: %3s\n", yesno(rssconf & DISABLE_F));
941
942 seq_puts(seq, "\n");
943
944 rssconf = t4_read_reg(adapter, TP_RSS_CONFIG_TNL_A);
945 seq_printf(seq, "TP_RSS_CONFIG_TNL: %#x\n", rssconf);
946 seq_printf(seq, " MaskSize: %3d\n", MASKSIZE_G(rssconf));
947 seq_printf(seq, " MaskFilter: %3d\n", MASKFILTER_G(rssconf));
948 if (CHELSIO_CHIP_VERSION(adapter->params.chip) > CHELSIO_T5) {
949 seq_printf(seq, " HashAll: %3s\n",
950 yesno(rssconf & HASHALL_F));
951 seq_printf(seq, " HashEth: %3s\n",
952 yesno(rssconf & HASHETH_F));
953 }
954 seq_printf(seq, " UseWireCh: %3s\n", yesno(rssconf & USEWIRECH_F));
955
956 seq_puts(seq, "\n");
957
958 rssconf = t4_read_reg(adapter, TP_RSS_CONFIG_OFD_A);
959 seq_printf(seq, "TP_RSS_CONFIG_OFD: %#x\n", rssconf);
960 seq_printf(seq, " MaskSize: %3d\n", MASKSIZE_G(rssconf));
961 seq_printf(seq, " RRCplMapEn: %3s\n", yesno(rssconf &
962 RRCPLMAPEN_F));
963 seq_printf(seq, " RRCplQueWidth: %3d\n", RRCPLQUEWIDTH_G(rssconf));
964
965 seq_puts(seq, "\n");
966
967 rssconf = t4_read_reg(adapter, TP_RSS_CONFIG_SYN_A);
968 seq_printf(seq, "TP_RSS_CONFIG_SYN: %#x\n", rssconf);
969 seq_printf(seq, " MaskSize: %3d\n", MASKSIZE_G(rssconf));
970 seq_printf(seq, " UseWireCh: %3s\n", yesno(rssconf & USEWIRECH_F));
971
972 seq_puts(seq, "\n");
973
974 rssconf = t4_read_reg(adapter, TP_RSS_CONFIG_VRT_A);
975 seq_printf(seq, "TP_RSS_CONFIG_VRT: %#x\n", rssconf);
976 if (CHELSIO_CHIP_VERSION(adapter->params.chip) > CHELSIO_T5) {
977 seq_printf(seq, " KeyWrAddrX: %3d\n",
978 KEYWRADDRX_G(rssconf));
979 seq_printf(seq, " KeyExtend: %3s\n",
980 yesno(rssconf & KEYEXTEND_F));
981 }
982 seq_printf(seq, " VfRdRg: %3s\n", yesno(rssconf & VFRDRG_F));
983 seq_printf(seq, " VfRdEn: %3s\n", yesno(rssconf & VFRDEN_F));
984 seq_printf(seq, " VfPerrEn: %3s\n", yesno(rssconf & VFPERREN_F));
985 seq_printf(seq, " KeyPerrEn: %3s\n", yesno(rssconf & KEYPERREN_F));
986 seq_printf(seq, " DisVfVlan: %3s\n", yesno(rssconf &
987 DISABLEVLAN_F));
988 seq_printf(seq, " EnUpSwt: %3s\n", yesno(rssconf & ENABLEUP0_F));
989 seq_printf(seq, " HashDelay: %3d\n", HASHDELAY_G(rssconf));
990 if (CHELSIO_CHIP_VERSION(adapter->params.chip) <= CHELSIO_T5)
991 seq_printf(seq, " VfWrAddr: %3d\n", VFWRADDR_G(rssconf));
992 seq_printf(seq, " KeyMode: %s\n", keymode[KEYMODE_G(rssconf)]);
993 seq_printf(seq, " VfWrEn: %3s\n", yesno(rssconf & VFWREN_F));
994 seq_printf(seq, " KeyWrEn: %3s\n", yesno(rssconf & KEYWREN_F));
995 seq_printf(seq, " KeyWrAddr: %3d\n", KEYWRADDR_G(rssconf));
996
997 seq_puts(seq, "\n");
998
999 rssconf = t4_read_reg(adapter, TP_RSS_CONFIG_CNG_A);
1000 seq_printf(seq, "TP_RSS_CONFIG_CNG: %#x\n", rssconf);
1001 seq_printf(seq, " ChnCount3: %3s\n", yesno(rssconf & CHNCOUNT3_F));
1002 seq_printf(seq, " ChnCount2: %3s\n", yesno(rssconf & CHNCOUNT2_F));
1003 seq_printf(seq, " ChnCount1: %3s\n", yesno(rssconf & CHNCOUNT1_F));
1004 seq_printf(seq, " ChnCount0: %3s\n", yesno(rssconf & CHNCOUNT0_F));
1005 seq_printf(seq, " ChnUndFlow3: %3s\n", yesno(rssconf &
1006 CHNUNDFLOW3_F));
1007 seq_printf(seq, " ChnUndFlow2: %3s\n", yesno(rssconf &
1008 CHNUNDFLOW2_F));
1009 seq_printf(seq, " ChnUndFlow1: %3s\n", yesno(rssconf &
1010 CHNUNDFLOW1_F));
1011 seq_printf(seq, " ChnUndFlow0: %3s\n", yesno(rssconf &
1012 CHNUNDFLOW0_F));
1013 seq_printf(seq, " RstChn3: %3s\n", yesno(rssconf & RSTCHN3_F));
1014 seq_printf(seq, " RstChn2: %3s\n", yesno(rssconf & RSTCHN2_F));
1015 seq_printf(seq, " RstChn1: %3s\n", yesno(rssconf & RSTCHN1_F));
1016 seq_printf(seq, " RstChn0: %3s\n", yesno(rssconf & RSTCHN0_F));
1017 seq_printf(seq, " UpdVld: %3s\n", yesno(rssconf & UPDVLD_F));
1018 seq_printf(seq, " Xoff: %3s\n", yesno(rssconf & XOFF_F));
1019 seq_printf(seq, " UpdChn3: %3s\n", yesno(rssconf & UPDCHN3_F));
1020 seq_printf(seq, " UpdChn2: %3s\n", yesno(rssconf & UPDCHN2_F));
1021 seq_printf(seq, " UpdChn1: %3s\n", yesno(rssconf & UPDCHN1_F));
1022 seq_printf(seq, " UpdChn0: %3s\n", yesno(rssconf & UPDCHN0_F));
1023 seq_printf(seq, " Queue: %3d\n", QUEUE_G(rssconf));
1024
1025 return 0;
1026}
1027
1028DEFINE_SIMPLE_DEBUGFS_FILE(rss_config);
1029
1030/* RSS Secret Key.
1031 */
1032
1033static int rss_key_show(struct seq_file *seq, void *v)
1034{
1035 u32 key[10];
1036
1037 t4_read_rss_key(seq->private, key);
1038 seq_printf(seq, "%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x\n",
1039 key[9], key[8], key[7], key[6], key[5], key[4], key[3],
1040 key[2], key[1], key[0]);
1041 return 0;
1042}
1043
1044static int rss_key_open(struct inode *inode, struct file *file)
1045{
1046 return single_open(file, rss_key_show, inode->i_private);
1047}
1048
1049static ssize_t rss_key_write(struct file *file, const char __user *buf,
1050 size_t count, loff_t *pos)
1051{
1052 int i, j;
1053 u32 key[10];
1054 char s[100], *p;
1055 struct adapter *adap = FILE_DATA(file)->i_private;
1056
1057 if (count > sizeof(s) - 1)
1058 return -EINVAL;
1059 if (copy_from_user(s, buf, count))
1060 return -EFAULT;
1061 for (i = count; i > 0 && isspace(s[i - 1]); i--)
1062 ;
1063 s[i] = '\0';
1064
1065 for (p = s, i = 9; i >= 0; i--) {
1066 key[i] = 0;
1067 for (j = 0; j < 8; j++, p++) {
1068 if (!isxdigit(*p))
1069 return -EINVAL;
1070 key[i] = (key[i] << 4) | hex2val(*p);
1071 }
1072 }
1073
1074 t4_write_rss_key(adap, key, -1);
1075 return count;
1076}
1077
1078static const struct file_operations rss_key_debugfs_fops = {
1079 .owner = THIS_MODULE,
1080 .open = rss_key_open,
1081 .read = seq_read,
1082 .llseek = seq_lseek,
1083 .release = single_release,
1084 .write = rss_key_write
1085};
1086
1087/* PF RSS Configuration.
1088 */
1089
1090struct rss_pf_conf {
1091 u32 rss_pf_map;
1092 u32 rss_pf_mask;
1093 u32 rss_pf_config;
1094};
1095
1096static int rss_pf_config_show(struct seq_file *seq, void *v, int idx)
1097{
1098 struct rss_pf_conf *pfconf;
1099
1100 if (v == SEQ_START_TOKEN) {
1101 /* use the 0th entry to dump the PF Map Index Size */
1102 pfconf = seq->private + offsetof(struct seq_tab, data);
1103 seq_printf(seq, "PF Map Index Size = %d\n\n",
1104 LKPIDXSIZE_G(pfconf->rss_pf_map));
1105
1106 seq_puts(seq, " RSS PF VF Hash Tuple Enable Default\n");
1107 seq_puts(seq, " Enable IPF Mask Mask IPv6 IPv4 UDP Queue\n");
1108 seq_puts(seq, " PF Map Chn Prt Map Size Size Four Two Four Two Four Ch1 Ch0\n");
1109 } else {
1110 #define G_PFnLKPIDX(map, n) \
1111 (((map) >> PF1LKPIDX_S*(n)) & PF0LKPIDX_M)
1112 #define G_PFnMSKSIZE(mask, n) \
1113 (((mask) >> PF1MSKSIZE_S*(n)) & PF1MSKSIZE_M)
1114
1115 pfconf = v;
1116 seq_printf(seq, "%3d %3s %3s %3s %3d %3d %3d %3s %3s %3s %3s %3s %3d %3d\n",
1117 idx,
1118 yesno(pfconf->rss_pf_config & MAPENABLE_F),
1119 yesno(pfconf->rss_pf_config & CHNENABLE_F),
1120 yesno(pfconf->rss_pf_config & PRTENABLE_F),
1121 G_PFnLKPIDX(pfconf->rss_pf_map, idx),
1122 G_PFnMSKSIZE(pfconf->rss_pf_mask, idx),
1123 IVFWIDTH_G(pfconf->rss_pf_config),
1124 yesno(pfconf->rss_pf_config & IP6FOURTUPEN_F),
1125 yesno(pfconf->rss_pf_config & IP6TWOTUPEN_F),
1126 yesno(pfconf->rss_pf_config & IP4FOURTUPEN_F),
1127 yesno(pfconf->rss_pf_config & IP4TWOTUPEN_F),
1128 yesno(pfconf->rss_pf_config & UDPFOURTUPEN_F),
1129 CH1DEFAULTQUEUE_G(pfconf->rss_pf_config),
1130 CH0DEFAULTQUEUE_G(pfconf->rss_pf_config));
1131
1132 #undef G_PFnLKPIDX
1133 #undef G_PFnMSKSIZE
1134 }
1135 return 0;
1136}
1137
1138static int rss_pf_config_open(struct inode *inode, struct file *file)
1139{
1140 struct adapter *adapter = inode->i_private;
1141 struct seq_tab *p;
1142 u32 rss_pf_map, rss_pf_mask;
1143 struct rss_pf_conf *pfconf;
1144 int pf;
1145
1146 p = seq_open_tab(file, 8, sizeof(*pfconf), 1, rss_pf_config_show);
1147 if (!p)
1148 return -ENOMEM;
1149
1150 pfconf = (struct rss_pf_conf *)p->data;
1151 rss_pf_map = t4_read_rss_pf_map(adapter);
1152 rss_pf_mask = t4_read_rss_pf_mask(adapter);
1153 for (pf = 0; pf < 8; pf++) {
1154 pfconf[pf].rss_pf_map = rss_pf_map;
1155 pfconf[pf].rss_pf_mask = rss_pf_mask;
1156 t4_read_rss_pf_config(adapter, pf, &pfconf[pf].rss_pf_config);
1157 }
1158 return 0;
1159}
1160
1161static const struct file_operations rss_pf_config_debugfs_fops = {
1162 .owner = THIS_MODULE,
1163 .open = rss_pf_config_open,
1164 .read = seq_read,
1165 .llseek = seq_lseek,
1166 .release = seq_release_private
1167};
1168
1169/* VF RSS Configuration.
1170 */
1171
1172struct rss_vf_conf {
1173 u32 rss_vf_vfl;
1174 u32 rss_vf_vfh;
1175};
1176
1177static int rss_vf_config_show(struct seq_file *seq, void *v, int idx)
1178{
1179 if (v == SEQ_START_TOKEN) {
1180 seq_puts(seq, " RSS Hash Tuple Enable\n");
1181 seq_puts(seq, " Enable IVF Dis Enb IPv6 IPv4 UDP Def Secret Key\n");
1182 seq_puts(seq, " VF Chn Prt Map VLAN uP Four Two Four Two Four Que Idx Hash\n");
1183 } else {
1184 struct rss_vf_conf *vfconf = v;
1185
1186 seq_printf(seq, "%3d %3s %3s %3d %3s %3s %3s %3s %3s %3s %3s %4d %3d %#10x\n",
1187 idx,
1188 yesno(vfconf->rss_vf_vfh & VFCHNEN_F),
1189 yesno(vfconf->rss_vf_vfh & VFPRTEN_F),
1190 VFLKPIDX_G(vfconf->rss_vf_vfh),
1191 yesno(vfconf->rss_vf_vfh & VFVLNEX_F),
1192 yesno(vfconf->rss_vf_vfh & VFUPEN_F),
1193 yesno(vfconf->rss_vf_vfh & VFIP4FOURTUPEN_F),
1194 yesno(vfconf->rss_vf_vfh & VFIP6TWOTUPEN_F),
1195 yesno(vfconf->rss_vf_vfh & VFIP4FOURTUPEN_F),
1196 yesno(vfconf->rss_vf_vfh & VFIP4TWOTUPEN_F),
1197 yesno(vfconf->rss_vf_vfh & ENABLEUDPHASH_F),
1198 DEFAULTQUEUE_G(vfconf->rss_vf_vfh),
1199 KEYINDEX_G(vfconf->rss_vf_vfh),
1200 vfconf->rss_vf_vfl);
1201 }
1202 return 0;
1203}
1204
1205static int rss_vf_config_open(struct inode *inode, struct file *file)
1206{
1207 struct adapter *adapter = inode->i_private;
1208 struct seq_tab *p;
1209 struct rss_vf_conf *vfconf;
1210 int vf;
1211
1212 p = seq_open_tab(file, 128, sizeof(*vfconf), 1, rss_vf_config_show);
1213 if (!p)
1214 return -ENOMEM;
1215
1216 vfconf = (struct rss_vf_conf *)p->data;
1217 for (vf = 0; vf < 128; vf++) {
1218 t4_read_rss_vf_config(adapter, vf, &vfconf[vf].rss_vf_vfl,
1219 &vfconf[vf].rss_vf_vfh);
1220 }
1221 return 0;
1222}
1223
1224static const struct file_operations rss_vf_config_debugfs_fops = {
1225 .owner = THIS_MODULE,
1226 .open = rss_vf_config_open,
1227 .read = seq_read,
1228 .llseek = seq_lseek,
1229 .release = seq_release_private
1230};
1231
3051fa61
HS
1232/**
1233 * ethqset2pinfo - return port_info of an Ethernet Queue Set
1234 * @adap: the adapter
1235 * @qset: Ethernet Queue Set
1236 */
1237static inline struct port_info *ethqset2pinfo(struct adapter *adap, int qset)
1238{
1239 int pidx;
1240
1241 for_each_port(adap, pidx) {
1242 struct port_info *pi = adap2pinfo(adap, pidx);
1243
1244 if (qset >= pi->first_qset &&
1245 qset < pi->first_qset + pi->nqsets)
1246 return pi;
1247 }
1248
1249 /* should never happen! */
1250 BUG_ON(1);
1251 return NULL;
1252}
1253
dc9daab2
HS
1254static int sge_qinfo_show(struct seq_file *seq, void *v)
1255{
1256 struct adapter *adap = seq->private;
1257 int eth_entries = DIV_ROUND_UP(adap->sge.ethqsets, 4);
1258 int toe_entries = DIV_ROUND_UP(adap->sge.ofldqsets, 4);
1259 int rdma_entries = DIV_ROUND_UP(adap->sge.rdmaqs, 4);
1260 int ciq_entries = DIV_ROUND_UP(adap->sge.rdmaciqs, 4);
1261 int ctrl_entries = DIV_ROUND_UP(MAX_CTRL_QUEUES, 4);
1262 int i, r = (uintptr_t)v - 1;
1263 int toe_idx = r - eth_entries;
1264 int rdma_idx = toe_idx - toe_entries;
1265 int ciq_idx = rdma_idx - rdma_entries;
1266 int ctrl_idx = ciq_idx - ciq_entries;
1267 int fq_idx = ctrl_idx - ctrl_entries;
1268
1269 if (r)
1270 seq_putc(seq, '\n');
1271
1272#define S3(fmt_spec, s, v) \
1273do { \
1274 seq_printf(seq, "%-12s", s); \
1275 for (i = 0; i < n; ++i) \
1276 seq_printf(seq, " %16" fmt_spec, v); \
1277 seq_putc(seq, '\n'); \
1278} while (0)
1279#define S(s, v) S3("s", s, v)
1280#define T(s, v) S3("u", s, tx[i].v)
1281#define R(s, v) S3("u", s, rx[i].v)
1282
1283 if (r < eth_entries) {
1284 int base_qset = r * 4;
1285 const struct sge_eth_rxq *rx = &adap->sge.ethrxq[base_qset];
1286 const struct sge_eth_txq *tx = &adap->sge.ethtxq[base_qset];
1287 int n = min(4, adap->sge.ethqsets - 4 * r);
1288
1289 S("QType:", "Ethernet");
1290 S("Interface:",
1291 rx[i].rspq.netdev ? rx[i].rspq.netdev->name : "N/A");
1292 T("TxQ ID:", q.cntxt_id);
1293 T("TxQ size:", q.size);
1294 T("TxQ inuse:", q.in_use);
1295 T("TxQ CIDX:", q.cidx);
1296 T("TxQ PIDX:", q.pidx);
3051fa61 1297#ifdef CONFIG_CHELSIO_T4_DCB
dc9daab2
HS
1298 T("DCB Prio:", dcb_prio);
1299 S3("u", "DCB PGID:",
1300 (ethqset2pinfo(adap, base_qset + i)->dcb.pgid >>
1301 4*(7-tx[i].dcb_prio)) & 0xf);
1302 S3("u", "DCB PFC:",
1303 (ethqset2pinfo(adap, base_qset + i)->dcb.pfcen >>
1304 1*(7-tx[i].dcb_prio)) & 0x1);
1305#endif
1306 R("RspQ ID:", rspq.abs_id);
1307 R("RspQ size:", rspq.size);
1308 R("RspQE size:", rspq.iqe_len);
1309 R("RspQ CIDX:", rspq.cidx);
1310 R("RspQ Gen:", rspq.gen);
1311 S3("u", "Intr delay:", qtimer_val(adap, &rx[i].rspq));
1312 S3("u", "Intr pktcnt:",
1313 adap->sge.counter_val[rx[i].rspq.pktcnt_idx]);
1314 R("FL ID:", fl.cntxt_id);
1315 R("FL size:", fl.size - 8);
1316 R("FL pend:", fl.pend_cred);
1317 R("FL avail:", fl.avail);
1318 R("FL PIDX:", fl.pidx);
1319 R("FL CIDX:", fl.cidx);
1320 } else if (toe_idx < toe_entries) {
1321 const struct sge_ofld_rxq *rx = &adap->sge.ofldrxq[toe_idx * 4];
1322 const struct sge_ofld_txq *tx = &adap->sge.ofldtxq[toe_idx * 4];
1323 int n = min(4, adap->sge.ofldqsets - 4 * toe_idx);
1324
1325 S("QType:", "TOE");
1326 T("TxQ ID:", q.cntxt_id);
1327 T("TxQ size:", q.size);
1328 T("TxQ inuse:", q.in_use);
1329 T("TxQ CIDX:", q.cidx);
1330 T("TxQ PIDX:", q.pidx);
1331 R("RspQ ID:", rspq.abs_id);
1332 R("RspQ size:", rspq.size);
1333 R("RspQE size:", rspq.iqe_len);
1334 R("RspQ CIDX:", rspq.cidx);
1335 R("RspQ Gen:", rspq.gen);
1336 S3("u", "Intr delay:", qtimer_val(adap, &rx[i].rspq));
1337 S3("u", "Intr pktcnt:",
1338 adap->sge.counter_val[rx[i].rspq.pktcnt_idx]);
1339 R("FL ID:", fl.cntxt_id);
1340 R("FL size:", fl.size - 8);
1341 R("FL pend:", fl.pend_cred);
1342 R("FL avail:", fl.avail);
1343 R("FL PIDX:", fl.pidx);
1344 R("FL CIDX:", fl.cidx);
1345 } else if (rdma_idx < rdma_entries) {
1346 const struct sge_ofld_rxq *rx =
1347 &adap->sge.rdmarxq[rdma_idx * 4];
1348 int n = min(4, adap->sge.rdmaqs - 4 * rdma_idx);
1349
1350 S("QType:", "RDMA-CPL");
1351 R("RspQ ID:", rspq.abs_id);
1352 R("RspQ size:", rspq.size);
1353 R("RspQE size:", rspq.iqe_len);
1354 R("RspQ CIDX:", rspq.cidx);
1355 R("RspQ Gen:", rspq.gen);
1356 S3("u", "Intr delay:", qtimer_val(adap, &rx[i].rspq));
1357 S3("u", "Intr pktcnt:",
1358 adap->sge.counter_val[rx[i].rspq.pktcnt_idx]);
1359 R("FL ID:", fl.cntxt_id);
1360 R("FL size:", fl.size - 8);
1361 R("FL pend:", fl.pend_cred);
1362 R("FL avail:", fl.avail);
1363 R("FL PIDX:", fl.pidx);
1364 R("FL CIDX:", fl.cidx);
1365 } else if (ciq_idx < ciq_entries) {
1366 const struct sge_ofld_rxq *rx = &adap->sge.rdmaciq[ciq_idx * 4];
1367 int n = min(4, adap->sge.rdmaciqs - 4 * ciq_idx);
1368
1369 S("QType:", "RDMA-CIQ");
1370 R("RspQ ID:", rspq.abs_id);
1371 R("RspQ size:", rspq.size);
1372 R("RspQE size:", rspq.iqe_len);
1373 R("RspQ CIDX:", rspq.cidx);
1374 R("RspQ Gen:", rspq.gen);
1375 S3("u", "Intr delay:", qtimer_val(adap, &rx[i].rspq));
1376 S3("u", "Intr pktcnt:",
1377 adap->sge.counter_val[rx[i].rspq.pktcnt_idx]);
1378 } else if (ctrl_idx < ctrl_entries) {
1379 const struct sge_ctrl_txq *tx = &adap->sge.ctrlq[ctrl_idx * 4];
1380 int n = min(4, adap->params.nports - 4 * ctrl_idx);
1381
1382 S("QType:", "Control");
1383 T("TxQ ID:", q.cntxt_id);
1384 T("TxQ size:", q.size);
1385 T("TxQ inuse:", q.in_use);
1386 T("TxQ CIDX:", q.cidx);
1387 T("TxQ PIDX:", q.pidx);
1388 } else if (fq_idx == 0) {
1389 const struct sge_rspq *evtq = &adap->sge.fw_evtq;
1390
1391 seq_printf(seq, "%-12s %16s\n", "QType:", "FW event queue");
1392 seq_printf(seq, "%-12s %16u\n", "RspQ ID:", evtq->abs_id);
1393 seq_printf(seq, "%-12s %16u\n", "RspQ size:", evtq->size);
1394 seq_printf(seq, "%-12s %16u\n", "RspQE size:", evtq->iqe_len);
1395 seq_printf(seq, "%-12s %16u\n", "RspQ CIDX:", evtq->cidx);
1396 seq_printf(seq, "%-12s %16u\n", "RspQ Gen:", evtq->gen);
1397 seq_printf(seq, "%-12s %16u\n", "Intr delay:",
1398 qtimer_val(adap, evtq));
1399 seq_printf(seq, "%-12s %16u\n", "Intr pktcnt:",
1400 adap->sge.counter_val[evtq->pktcnt_idx]);
1401 }
1402#undef R
1403#undef T
1404#undef S
1405#undef S3
1406return 0;
1407}
1408
1409static int sge_queue_entries(const struct adapter *adap)
1410{
1411 return DIV_ROUND_UP(adap->sge.ethqsets, 4) +
1412 DIV_ROUND_UP(adap->sge.ofldqsets, 4) +
1413 DIV_ROUND_UP(adap->sge.rdmaqs, 4) +
1414 DIV_ROUND_UP(adap->sge.rdmaciqs, 4) +
1415 DIV_ROUND_UP(MAX_CTRL_QUEUES, 4) + 1;
1416}
1417
1418static void *sge_queue_start(struct seq_file *seq, loff_t *pos)
1419{
1420 int entries = sge_queue_entries(seq->private);
1421
1422 return *pos < entries ? (void *)((uintptr_t)*pos + 1) : NULL;
1423}
1424
1425static void sge_queue_stop(struct seq_file *seq, void *v)
1426{
1427}
1428
1429static void *sge_queue_next(struct seq_file *seq, void *v, loff_t *pos)
1430{
1431 int entries = sge_queue_entries(seq->private);
1432
1433 ++*pos;
1434 return *pos < entries ? (void *)((uintptr_t)*pos + 1) : NULL;
1435}
1436
1437static const struct seq_operations sge_qinfo_seq_ops = {
1438 .start = sge_queue_start,
1439 .next = sge_queue_next,
1440 .stop = sge_queue_stop,
1441 .show = sge_qinfo_show
1442};
1443
1444static int sge_qinfo_open(struct inode *inode, struct file *file)
1445{
1446 int res = seq_open(file, &sge_qinfo_seq_ops);
1447
1448 if (!res) {
1449 struct seq_file *seq = file->private_data;
1450
1451 seq->private = inode->i_private;
1452 }
1453 return res;
1454}
1455
1456static const struct file_operations sge_qinfo_debugfs_fops = {
1457 .owner = THIS_MODULE,
1458 .open = sge_qinfo_open,
1459 .read = seq_read,
1460 .llseek = seq_lseek,
1461 .release = seq_release,
1462};
1463
49216c1c
HS
1464int mem_open(struct inode *inode, struct file *file)
1465{
1466 unsigned int mem;
1467 struct adapter *adap;
1468
1469 file->private_data = inode->i_private;
1470
1471 mem = (uintptr_t)file->private_data & 0x3;
1472 adap = file->private_data - mem;
1473
1474 (void)t4_fwcache(adap, FW_PARAM_DEV_FWCACHE_FLUSH);
1475
1476 return 0;
1477}
1478
fd88b31a
HS
1479static ssize_t mem_read(struct file *file, char __user *buf, size_t count,
1480 loff_t *ppos)
1481{
1482 loff_t pos = *ppos;
1483 loff_t avail = file_inode(file)->i_size;
1484 unsigned int mem = (uintptr_t)file->private_data & 3;
1485 struct adapter *adap = file->private_data - mem;
1486 __be32 *data;
1487 int ret;
1488
1489 if (pos < 0)
1490 return -EINVAL;
1491 if (pos >= avail)
1492 return 0;
1493 if (count > avail - pos)
1494 count = avail - pos;
1495
1496 data = t4_alloc_mem(count);
1497 if (!data)
1498 return -ENOMEM;
1499
1500 spin_lock(&adap->win0_lock);
1501 ret = t4_memory_rw(adap, 0, mem, pos, count, data, T4_MEMORY_READ);
1502 spin_unlock(&adap->win0_lock);
1503 if (ret) {
1504 t4_free_mem(data);
1505 return ret;
1506 }
1507 ret = copy_to_user(buf, data, count);
1508
1509 t4_free_mem(data);
1510 if (ret)
1511 return -EFAULT;
1512
1513 *ppos = pos + count;
1514 return count;
1515}
fd88b31a
HS
1516static const struct file_operations mem_debugfs_fops = {
1517 .owner = THIS_MODULE,
1518 .open = simple_open,
1519 .read = mem_read,
1520 .llseek = default_llseek,
1521};
1522
49216c1c
HS
1523static void set_debugfs_file_size(struct dentry *de, loff_t size)
1524{
1525 if (!IS_ERR(de) && de->d_inode)
1526 de->d_inode->i_size = size;
1527}
1528
fd88b31a
HS
1529static void add_debugfs_mem(struct adapter *adap, const char *name,
1530 unsigned int idx, unsigned int size_mb)
1531{
1532 struct dentry *de;
1533
1534 de = debugfs_create_file(name, S_IRUSR, adap->debugfs_root,
1535 (void *)adap + idx, &mem_debugfs_fops);
1536 if (de && de->d_inode)
1537 de->d_inode->i_size = size_mb << 20;
1538}
1539
1540/* Add an array of Debug FS files.
1541 */
1542void add_debugfs_files(struct adapter *adap,
1543 struct t4_debugfs_entry *files,
1544 unsigned int nfiles)
1545{
1546 int i;
1547
1548 /* debugfs support is best effort */
1549 for (i = 0; i < nfiles; i++)
1550 debugfs_create_file(files[i].name, files[i].mode,
1551 adap->debugfs_root,
1552 (void *)adap + files[i].data,
1553 files[i].ops);
1554}
1555
1556int t4_setup_debugfs(struct adapter *adap)
1557{
1558 int i;
1559 u32 size;
49216c1c 1560 struct dentry *de;
fd88b31a
HS
1561
1562 static struct t4_debugfs_entry t4_debugfs_files[] = {
f1ff24aa 1563 { "cim_la", &cim_la_fops, S_IRUSR, 0 },
74b3092c 1564 { "cim_qcfg", &cim_qcfg_fops, S_IRUSR, 0 },
b58b6676 1565 { "clk", &clk_debugfs_fops, S_IRUSR, 0 },
49aa284f 1566 { "devlog", &devlog_fops, S_IRUSR, 0 },
fd88b31a 1567 { "l2t", &t4_l2t_fops, S_IRUSR, 0},
ef82f662 1568 { "mps_tcam", &mps_tcam_debugfs_fops, S_IRUSR, 0 },
688ea5fe
HS
1569 { "rss", &rss_debugfs_fops, S_IRUSR, 0 },
1570 { "rss_config", &rss_config_debugfs_fops, S_IRUSR, 0 },
1571 { "rss_key", &rss_key_debugfs_fops, S_IRUSR, 0 },
1572 { "rss_pf_config", &rss_pf_config_debugfs_fops, S_IRUSR, 0 },
1573 { "rss_vf_config", &rss_vf_config_debugfs_fops, S_IRUSR, 0 },
dc9daab2 1574 { "sge_qinfo", &sge_qinfo_debugfs_fops, S_IRUSR, 0 },
e5f0e43b
HS
1575 { "ibq_tp0", &cim_ibq_fops, S_IRUSR, 0 },
1576 { "ibq_tp1", &cim_ibq_fops, S_IRUSR, 1 },
1577 { "ibq_ulp", &cim_ibq_fops, S_IRUSR, 2 },
1578 { "ibq_sge0", &cim_ibq_fops, S_IRUSR, 3 },
1579 { "ibq_sge1", &cim_ibq_fops, S_IRUSR, 4 },
1580 { "ibq_ncsi", &cim_ibq_fops, S_IRUSR, 5 },
c778af7d
HS
1581 { "obq_ulp0", &cim_obq_fops, S_IRUSR, 0 },
1582 { "obq_ulp1", &cim_obq_fops, S_IRUSR, 1 },
1583 { "obq_ulp2", &cim_obq_fops, S_IRUSR, 2 },
1584 { "obq_ulp3", &cim_obq_fops, S_IRUSR, 3 },
1585 { "obq_sge", &cim_obq_fops, S_IRUSR, 4 },
1586 { "obq_ncsi", &cim_obq_fops, S_IRUSR, 5 },
b3bbe36a 1587 { "pm_stats", &pm_stats_debugfs_fops, S_IRUSR, 0 },
b5a02f50
AB
1588#if IS_ENABLED(CONFIG_IPV6)
1589 { "clip_tbl", &clip_tbl_debugfs_fops, S_IRUSR, 0 },
1590#endif
fd88b31a
HS
1591 };
1592
c778af7d
HS
1593 /* Debug FS nodes common to all T5 and later adapters.
1594 */
1595 static struct t4_debugfs_entry t5_debugfs_files[] = {
1596 { "obq_sge_rx_q0", &cim_obq_fops, S_IRUSR, 6 },
1597 { "obq_sge_rx_q1", &cim_obq_fops, S_IRUSR, 7 },
1598 };
1599
fd88b31a
HS
1600 add_debugfs_files(adap,
1601 t4_debugfs_files,
1602 ARRAY_SIZE(t4_debugfs_files));
c778af7d
HS
1603 if (!is_t4(adap->params.chip))
1604 add_debugfs_files(adap,
1605 t5_debugfs_files,
1606 ARRAY_SIZE(t5_debugfs_files));
fd88b31a 1607
6559a7e8
HS
1608 i = t4_read_reg(adap, MA_TARGET_MEM_ENABLE_A);
1609 if (i & EDRAM0_ENABLE_F) {
1610 size = t4_read_reg(adap, MA_EDRAM0_BAR_A);
1611 add_debugfs_mem(adap, "edc0", MEM_EDC0, EDRAM0_SIZE_G(size));
fd88b31a 1612 }
6559a7e8
HS
1613 if (i & EDRAM1_ENABLE_F) {
1614 size = t4_read_reg(adap, MA_EDRAM1_BAR_A);
1615 add_debugfs_mem(adap, "edc1", MEM_EDC1, EDRAM1_SIZE_G(size));
fd88b31a
HS
1616 }
1617 if (is_t4(adap->params.chip)) {
6559a7e8
HS
1618 size = t4_read_reg(adap, MA_EXT_MEMORY_BAR_A);
1619 if (i & EXT_MEM_ENABLE_F)
fd88b31a 1620 add_debugfs_mem(adap, "mc", MEM_MC,
6559a7e8 1621 EXT_MEM_SIZE_G(size));
fd88b31a 1622 } else {
6559a7e8
HS
1623 if (i & EXT_MEM0_ENABLE_F) {
1624 size = t4_read_reg(adap, MA_EXT_MEMORY0_BAR_A);
fd88b31a 1625 add_debugfs_mem(adap, "mc0", MEM_MC0,
6559a7e8 1626 EXT_MEM0_SIZE_G(size));
fd88b31a 1627 }
6559a7e8
HS
1628 if (i & EXT_MEM1_ENABLE_F) {
1629 size = t4_read_reg(adap, MA_EXT_MEMORY1_BAR_A);
fd88b31a 1630 add_debugfs_mem(adap, "mc1", MEM_MC1,
6559a7e8 1631 EXT_MEM1_SIZE_G(size));
fd88b31a
HS
1632 }
1633 }
49216c1c
HS
1634
1635 de = debugfs_create_file("flash", S_IRUSR, adap->debugfs_root, adap,
1636 &flash_debugfs_fops);
1637 set_debugfs_file_size(de, adap->params.sf_size);
1638
fd88b31a
HS
1639 return 0;
1640}
This page took 0.185986 seconds and 5 git commands to generate.