hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/drivers/pci/switch/switchtec.c
....@@ -25,6 +25,15 @@
2525 module_param(max_devices, int, 0644);
2626 MODULE_PARM_DESC(max_devices, "max number of switchtec device instances");
2727
28
+static bool use_dma_mrpc = true;
29
+module_param(use_dma_mrpc, bool, 0644);
30
+MODULE_PARM_DESC(use_dma_mrpc,
31
+ "Enable the use of the DMA MRPC feature");
32
+
33
+static int nirqs = 32;
34
+module_param(nirqs, int, 0644);
35
+MODULE_PARM_DESC(nirqs, "number of interrupts to allocate (more may be useful for NTB applications)");
36
+
2837 static dev_t switchtec_devt;
2938 static DEFINE_IDA(switchtec_minor_ida);
3039
....@@ -43,10 +52,11 @@
4352
4453 enum mrpc_state state;
4554
46
- struct completion comp;
55
+ wait_queue_head_t cmd_comp;
4756 struct kref kref;
4857 struct list_head list;
4958
59
+ bool cmd_done;
5060 u32 cmd;
5161 u32 status;
5262 u32 return_code;
....@@ -68,7 +78,7 @@
6878 stuser->stdev = stdev;
6979 kref_init(&stuser->kref);
7080 INIT_LIST_HEAD(&stuser->list);
71
- init_completion(&stuser->comp);
81
+ init_waitqueue_head(&stuser->cmd_comp);
7282 stuser->event_cnt = atomic_read(&stdev->event_cnt);
7383
7484 dev_dbg(&stdev->dev, "%s: %p\n", __func__, stuser);
....@@ -113,6 +123,19 @@
113123
114124 static void mrpc_complete_cmd(struct switchtec_dev *stdev);
115125
126
+static void flush_wc_buf(struct switchtec_dev *stdev)
127
+{
128
+ struct ntb_dbmsg_regs __iomem *mmio_dbmsg;
129
+
130
+ /*
131
+ * odb (outbound doorbell) register is processed by low latency
132
+ * hardware and w/o side effect
133
+ */
134
+ mmio_dbmsg = (void __iomem *)stdev->mmio_ntb +
135
+ SWITCHTEC_NTB_REG_DBMSG_OFFSET;
136
+ ioread32(&mmio_dbmsg->odb);
137
+}
138
+
116139 static void mrpc_cmd_submit(struct switchtec_dev *stdev)
117140 {
118141 /* requires the mrpc_mutex to already be held when called */
....@@ -128,10 +151,16 @@
128151 stuser = list_entry(stdev->mrpc_queue.next, struct switchtec_user,
129152 list);
130153
154
+ if (stdev->dma_mrpc) {
155
+ stdev->dma_mrpc->status = SWITCHTEC_MRPC_STATUS_INPROGRESS;
156
+ memset(stdev->dma_mrpc->data, 0xFF, SWITCHTEC_MRPC_PAYLOAD_SIZE);
157
+ }
158
+
131159 stuser_set_state(stuser, MRPC_RUNNING);
132160 stdev->mrpc_busy = 1;
133161 memcpy_toio(&stdev->mmio_mrpc->input_data,
134162 stuser->data, stuser->data_len);
163
+ flush_wc_buf(stdev);
135164 iowrite32(stuser->cmd, &stdev->mmio_mrpc->cmd);
136165
137166 schedule_delayed_work(&stdev->mrpc_timeout,
....@@ -147,7 +176,7 @@
147176 kref_get(&stuser->kref);
148177 stuser->read_len = sizeof(stuser->data);
149178 stuser_set_state(stuser, MRPC_QUEUED);
150
- reinit_completion(&stuser->comp);
179
+ stuser->cmd_done = false;
151180 list_add_tail(&stuser->list, &stdev->mrpc_queue);
152181
153182 mrpc_cmd_submit(stdev);
....@@ -166,7 +195,11 @@
166195 stuser = list_entry(stdev->mrpc_queue.next, struct switchtec_user,
167196 list);
168197
169
- stuser->status = ioread32(&stdev->mmio_mrpc->status);
198
+ if (stdev->dma_mrpc)
199
+ stuser->status = stdev->dma_mrpc->status;
200
+ else
201
+ stuser->status = ioread32(&stdev->mmio_mrpc->status);
202
+
170203 if (stuser->status == SWITCHTEC_MRPC_STATUS_INPROGRESS)
171204 return;
172205
....@@ -176,15 +209,22 @@
176209 if (stuser->status != SWITCHTEC_MRPC_STATUS_DONE)
177210 goto out;
178211
179
- stuser->return_code = ioread32(&stdev->mmio_mrpc->ret_value);
212
+ if (stdev->dma_mrpc)
213
+ stuser->return_code = stdev->dma_mrpc->rtn_code;
214
+ else
215
+ stuser->return_code = ioread32(&stdev->mmio_mrpc->ret_value);
180216 if (stuser->return_code != 0)
181217 goto out;
182218
183
- memcpy_fromio(stuser->data, &stdev->mmio_mrpc->output_data,
184
- stuser->read_len);
185
-
219
+ if (stdev->dma_mrpc)
220
+ memcpy(stuser->data, &stdev->dma_mrpc->data,
221
+ stuser->read_len);
222
+ else
223
+ memcpy_fromio(stuser->data, &stdev->mmio_mrpc->output_data,
224
+ stuser->read_len);
186225 out:
187
- complete_all(&stuser->comp);
226
+ stuser->cmd_done = true;
227
+ wake_up_interruptible(&stuser->cmd_comp);
188228 list_del_init(&stuser->list);
189229 stuser_put(stuser);
190230 stdev->mrpc_busy = 0;
....@@ -217,7 +257,10 @@
217257
218258 mutex_lock(&stdev->mrpc_mutex);
219259
220
- status = ioread32(&stdev->mmio_mrpc->status);
260
+ if (stdev->dma_mrpc)
261
+ status = stdev->dma_mrpc->status;
262
+ else
263
+ status = ioread32(&stdev->mmio_mrpc->status);
221264 if (status == SWITCHTEC_MRPC_STATUS_INPROGRESS) {
222265 schedule_delayed_work(&stdev->mrpc_timeout,
223266 msecs_to_jiffies(500));
....@@ -225,7 +268,6 @@
225268 }
226269
227270 mrpc_complete_cmd(stdev);
228
-
229271 out:
230272 mutex_unlock(&stdev->mrpc_mutex);
231273 }
....@@ -277,8 +319,15 @@
277319 struct device_attribute *attr, char *buf) \
278320 { \
279321 struct switchtec_dev *stdev = to_stdev(dev); \
280
- return io_string_show(buf, &stdev->mmio_sys_info->field, \
281
- sizeof(stdev->mmio_sys_info->field)); \
322
+ struct sys_info_regs __iomem *si = stdev->mmio_sys_info; \
323
+ if (stdev->gen == SWITCHTEC_GEN3) \
324
+ return io_string_show(buf, &si->gen3.field, \
325
+ sizeof(si->gen3.field)); \
326
+ else if (stdev->gen == SWITCHTEC_GEN4) \
327
+ return io_string_show(buf, &si->gen4.field, \
328
+ sizeof(si->gen4.field)); \
329
+ else \
330
+ return -ENOTSUPP; \
282331 } \
283332 \
284333 static DEVICE_ATTR_RO(field)
....@@ -286,13 +335,31 @@
286335 DEVICE_ATTR_SYS_INFO_STR(vendor_id);
287336 DEVICE_ATTR_SYS_INFO_STR(product_id);
288337 DEVICE_ATTR_SYS_INFO_STR(product_revision);
289
-DEVICE_ATTR_SYS_INFO_STR(component_vendor);
338
+
339
+static ssize_t component_vendor_show(struct device *dev,
340
+ struct device_attribute *attr, char *buf)
341
+{
342
+ struct switchtec_dev *stdev = to_stdev(dev);
343
+ struct sys_info_regs __iomem *si = stdev->mmio_sys_info;
344
+
345
+ /* component_vendor field not supported after gen3 */
346
+ if (stdev->gen != SWITCHTEC_GEN3)
347
+ return sprintf(buf, "none\n");
348
+
349
+ return io_string_show(buf, &si->gen3.component_vendor,
350
+ sizeof(si->gen3.component_vendor));
351
+}
352
+static DEVICE_ATTR_RO(component_vendor);
290353
291354 static ssize_t component_id_show(struct device *dev,
292355 struct device_attribute *attr, char *buf)
293356 {
294357 struct switchtec_dev *stdev = to_stdev(dev);
295
- int id = ioread16(&stdev->mmio_sys_info->component_id);
358
+ int id = ioread16(&stdev->mmio_sys_info->gen3.component_id);
359
+
360
+ /* component_id field not supported after gen3 */
361
+ if (stdev->gen != SWITCHTEC_GEN3)
362
+ return sprintf(buf, "none\n");
296363
297364 return sprintf(buf, "PM%04X\n", id);
298365 }
....@@ -302,7 +369,11 @@
302369 struct device_attribute *attr, char *buf)
303370 {
304371 struct switchtec_dev *stdev = to_stdev(dev);
305
- int rev = ioread8(&stdev->mmio_sys_info->component_revision);
372
+ int rev = ioread8(&stdev->mmio_sys_info->gen3.component_revision);
373
+
374
+ /* component_revision field not supported after gen3 */
375
+ if (stdev->gen != SWITCHTEC_GEN3)
376
+ return sprintf(buf, "255\n");
306377
307378 return sprintf(buf, "%d\n", rev);
308379 }
....@@ -354,7 +425,7 @@
354425 return PTR_ERR(stuser);
355426
356427 filp->private_data = stuser;
357
- nonseekable_open(inode, filp);
428
+ stream_open(inode, filp);
358429
359430 dev_dbg(&stdev->dev, "%s: %p\n", __func__, stuser);
360431
....@@ -410,6 +481,12 @@
410481 rc = -EFAULT;
411482 goto out;
412483 }
484
+ if (((MRPC_CMD_ID(stuser->cmd) == MRPC_GAS_WRITE) ||
485
+ (MRPC_CMD_ID(stuser->cmd) == MRPC_GAS_READ)) &&
486
+ !capable(CAP_SYS_ADMIN)) {
487
+ rc = -EPERM;
488
+ goto out;
489
+ }
413490
414491 data += sizeof(stuser->cmd);
415492 rc = copy_from_user(&stuser->data, data, size - sizeof(stuser->cmd));
....@@ -454,10 +531,11 @@
454531 mutex_unlock(&stdev->mrpc_mutex);
455532
456533 if (filp->f_flags & O_NONBLOCK) {
457
- if (!try_wait_for_completion(&stuser->comp))
534
+ if (!stuser->cmd_done)
458535 return -EAGAIN;
459536 } else {
460
- rc = wait_for_completion_interruptible(&stuser->comp);
537
+ rc = wait_event_interruptible(stuser->cmd_comp,
538
+ stuser->cmd_done);
461539 if (rc < 0)
462540 return rc;
463541 }
....@@ -505,7 +583,7 @@
505583 struct switchtec_dev *stdev = stuser->stdev;
506584 __poll_t ret = 0;
507585
508
- poll_wait(filp, &stuser->comp.wait, wait);
586
+ poll_wait(filp, &stuser->cmd_comp, wait);
509587 poll_wait(filp, &stdev->event_wq, wait);
510588
511589 if (lock_mutex_and_test_alive(stdev))
....@@ -513,7 +591,7 @@
513591
514592 mutex_unlock(&stdev->mrpc_mutex);
515593
516
- if (try_wait_for_completion(&stuser->comp))
594
+ if (stuser->cmd_done)
517595 ret |= EPOLLIN | EPOLLRDNORM;
518596
519597 if (stuser->event_cnt != atomic_read(&stdev->event_cnt))
....@@ -528,8 +606,15 @@
528606 struct switchtec_ioctl_flash_info info = {0};
529607 struct flash_info_regs __iomem *fi = stdev->mmio_flash_info;
530608
531
- info.flash_length = ioread32(&fi->flash_length);
532
- info.num_partitions = SWITCHTEC_IOCTL_NUM_PARTITIONS;
609
+ if (stdev->gen == SWITCHTEC_GEN3) {
610
+ info.flash_length = ioread32(&fi->gen3.flash_length);
611
+ info.num_partitions = SWITCHTEC_NUM_PARTITIONS_GEN3;
612
+ } else if (stdev->gen == SWITCHTEC_GEN4) {
613
+ info.flash_length = ioread32(&fi->gen4.flash_length);
614
+ info.num_partitions = SWITCHTEC_NUM_PARTITIONS_GEN4;
615
+ } else {
616
+ return -ENOTSUPP;
617
+ }
533618
534619 if (copy_to_user(uinfo, &info, sizeof(info)))
535620 return -EFAULT;
....@@ -544,75 +629,200 @@
544629 info->length = ioread32(&pi->length);
545630 }
546631
547
-static int ioctl_flash_part_info(struct switchtec_dev *stdev,
548
- struct switchtec_ioctl_flash_part_info __user *uinfo)
632
+static int flash_part_info_gen3(struct switchtec_dev *stdev,
633
+ struct switchtec_ioctl_flash_part_info *info)
549634 {
550
- struct switchtec_ioctl_flash_part_info info = {0};
551
- struct flash_info_regs __iomem *fi = stdev->mmio_flash_info;
552
- struct sys_info_regs __iomem *si = stdev->mmio_sys_info;
635
+ struct flash_info_regs_gen3 __iomem *fi =
636
+ &stdev->mmio_flash_info->gen3;
637
+ struct sys_info_regs_gen3 __iomem *si = &stdev->mmio_sys_info->gen3;
553638 u32 active_addr = -1;
554639
555
- if (copy_from_user(&info, uinfo, sizeof(info)))
556
- return -EFAULT;
557
-
558
- switch (info.flash_partition) {
640
+ switch (info->flash_partition) {
559641 case SWITCHTEC_IOCTL_PART_CFG0:
560642 active_addr = ioread32(&fi->active_cfg);
561
- set_fw_info_part(&info, &fi->cfg0);
562
- if (ioread16(&si->cfg_running) == SWITCHTEC_CFG0_RUNNING)
563
- info.active |= SWITCHTEC_IOCTL_PART_RUNNING;
643
+ set_fw_info_part(info, &fi->cfg0);
644
+ if (ioread16(&si->cfg_running) == SWITCHTEC_GEN3_CFG0_RUNNING)
645
+ info->active |= SWITCHTEC_IOCTL_PART_RUNNING;
564646 break;
565647 case SWITCHTEC_IOCTL_PART_CFG1:
566648 active_addr = ioread32(&fi->active_cfg);
567
- set_fw_info_part(&info, &fi->cfg1);
568
- if (ioread16(&si->cfg_running) == SWITCHTEC_CFG1_RUNNING)
569
- info.active |= SWITCHTEC_IOCTL_PART_RUNNING;
649
+ set_fw_info_part(info, &fi->cfg1);
650
+ if (ioread16(&si->cfg_running) == SWITCHTEC_GEN3_CFG1_RUNNING)
651
+ info->active |= SWITCHTEC_IOCTL_PART_RUNNING;
570652 break;
571653 case SWITCHTEC_IOCTL_PART_IMG0:
572654 active_addr = ioread32(&fi->active_img);
573
- set_fw_info_part(&info, &fi->img0);
574
- if (ioread16(&si->img_running) == SWITCHTEC_IMG0_RUNNING)
575
- info.active |= SWITCHTEC_IOCTL_PART_RUNNING;
655
+ set_fw_info_part(info, &fi->img0);
656
+ if (ioread16(&si->img_running) == SWITCHTEC_GEN3_IMG0_RUNNING)
657
+ info->active |= SWITCHTEC_IOCTL_PART_RUNNING;
576658 break;
577659 case SWITCHTEC_IOCTL_PART_IMG1:
578660 active_addr = ioread32(&fi->active_img);
579
- set_fw_info_part(&info, &fi->img1);
580
- if (ioread16(&si->img_running) == SWITCHTEC_IMG1_RUNNING)
581
- info.active |= SWITCHTEC_IOCTL_PART_RUNNING;
661
+ set_fw_info_part(info, &fi->img1);
662
+ if (ioread16(&si->img_running) == SWITCHTEC_GEN3_IMG1_RUNNING)
663
+ info->active |= SWITCHTEC_IOCTL_PART_RUNNING;
582664 break;
583665 case SWITCHTEC_IOCTL_PART_NVLOG:
584
- set_fw_info_part(&info, &fi->nvlog);
666
+ set_fw_info_part(info, &fi->nvlog);
585667 break;
586668 case SWITCHTEC_IOCTL_PART_VENDOR0:
587
- set_fw_info_part(&info, &fi->vendor[0]);
669
+ set_fw_info_part(info, &fi->vendor[0]);
588670 break;
589671 case SWITCHTEC_IOCTL_PART_VENDOR1:
590
- set_fw_info_part(&info, &fi->vendor[1]);
672
+ set_fw_info_part(info, &fi->vendor[1]);
591673 break;
592674 case SWITCHTEC_IOCTL_PART_VENDOR2:
593
- set_fw_info_part(&info, &fi->vendor[2]);
675
+ set_fw_info_part(info, &fi->vendor[2]);
594676 break;
595677 case SWITCHTEC_IOCTL_PART_VENDOR3:
596
- set_fw_info_part(&info, &fi->vendor[3]);
678
+ set_fw_info_part(info, &fi->vendor[3]);
597679 break;
598680 case SWITCHTEC_IOCTL_PART_VENDOR4:
599
- set_fw_info_part(&info, &fi->vendor[4]);
681
+ set_fw_info_part(info, &fi->vendor[4]);
600682 break;
601683 case SWITCHTEC_IOCTL_PART_VENDOR5:
602
- set_fw_info_part(&info, &fi->vendor[5]);
684
+ set_fw_info_part(info, &fi->vendor[5]);
603685 break;
604686 case SWITCHTEC_IOCTL_PART_VENDOR6:
605
- set_fw_info_part(&info, &fi->vendor[6]);
687
+ set_fw_info_part(info, &fi->vendor[6]);
606688 break;
607689 case SWITCHTEC_IOCTL_PART_VENDOR7:
608
- set_fw_info_part(&info, &fi->vendor[7]);
690
+ set_fw_info_part(info, &fi->vendor[7]);
609691 break;
610692 default:
611693 return -EINVAL;
612694 }
613695
614
- if (info.address == active_addr)
615
- info.active |= SWITCHTEC_IOCTL_PART_ACTIVE;
696
+ if (info->address == active_addr)
697
+ info->active |= SWITCHTEC_IOCTL_PART_ACTIVE;
698
+
699
+ return 0;
700
+}
701
+
702
+static int flash_part_info_gen4(struct switchtec_dev *stdev,
703
+ struct switchtec_ioctl_flash_part_info *info)
704
+{
705
+ struct flash_info_regs_gen4 __iomem *fi = &stdev->mmio_flash_info->gen4;
706
+ struct sys_info_regs_gen4 __iomem *si = &stdev->mmio_sys_info->gen4;
707
+ struct active_partition_info_gen4 __iomem *af = &fi->active_flag;
708
+
709
+ switch (info->flash_partition) {
710
+ case SWITCHTEC_IOCTL_PART_MAP_0:
711
+ set_fw_info_part(info, &fi->map0);
712
+ break;
713
+ case SWITCHTEC_IOCTL_PART_MAP_1:
714
+ set_fw_info_part(info, &fi->map1);
715
+ break;
716
+ case SWITCHTEC_IOCTL_PART_KEY_0:
717
+ set_fw_info_part(info, &fi->key0);
718
+ if (ioread8(&af->key) == SWITCHTEC_GEN4_KEY0_ACTIVE)
719
+ info->active |= SWITCHTEC_IOCTL_PART_ACTIVE;
720
+ if (ioread16(&si->key_running) == SWITCHTEC_GEN4_KEY0_RUNNING)
721
+ info->active |= SWITCHTEC_IOCTL_PART_RUNNING;
722
+ break;
723
+ case SWITCHTEC_IOCTL_PART_KEY_1:
724
+ set_fw_info_part(info, &fi->key1);
725
+ if (ioread8(&af->key) == SWITCHTEC_GEN4_KEY1_ACTIVE)
726
+ info->active |= SWITCHTEC_IOCTL_PART_ACTIVE;
727
+ if (ioread16(&si->key_running) == SWITCHTEC_GEN4_KEY1_RUNNING)
728
+ info->active |= SWITCHTEC_IOCTL_PART_RUNNING;
729
+ break;
730
+ case SWITCHTEC_IOCTL_PART_BL2_0:
731
+ set_fw_info_part(info, &fi->bl2_0);
732
+ if (ioread8(&af->bl2) == SWITCHTEC_GEN4_BL2_0_ACTIVE)
733
+ info->active |= SWITCHTEC_IOCTL_PART_ACTIVE;
734
+ if (ioread16(&si->bl2_running) == SWITCHTEC_GEN4_BL2_0_RUNNING)
735
+ info->active |= SWITCHTEC_IOCTL_PART_RUNNING;
736
+ break;
737
+ case SWITCHTEC_IOCTL_PART_BL2_1:
738
+ set_fw_info_part(info, &fi->bl2_1);
739
+ if (ioread8(&af->bl2) == SWITCHTEC_GEN4_BL2_1_ACTIVE)
740
+ info->active |= SWITCHTEC_IOCTL_PART_ACTIVE;
741
+ if (ioread16(&si->bl2_running) == SWITCHTEC_GEN4_BL2_1_RUNNING)
742
+ info->active |= SWITCHTEC_IOCTL_PART_RUNNING;
743
+ break;
744
+ case SWITCHTEC_IOCTL_PART_CFG0:
745
+ set_fw_info_part(info, &fi->cfg0);
746
+ if (ioread8(&af->cfg) == SWITCHTEC_GEN4_CFG0_ACTIVE)
747
+ info->active |= SWITCHTEC_IOCTL_PART_ACTIVE;
748
+ if (ioread16(&si->cfg_running) == SWITCHTEC_GEN4_CFG0_RUNNING)
749
+ info->active |= SWITCHTEC_IOCTL_PART_RUNNING;
750
+ break;
751
+ case SWITCHTEC_IOCTL_PART_CFG1:
752
+ set_fw_info_part(info, &fi->cfg1);
753
+ if (ioread8(&af->cfg) == SWITCHTEC_GEN4_CFG1_ACTIVE)
754
+ info->active |= SWITCHTEC_IOCTL_PART_ACTIVE;
755
+ if (ioread16(&si->cfg_running) == SWITCHTEC_GEN4_CFG1_RUNNING)
756
+ info->active |= SWITCHTEC_IOCTL_PART_RUNNING;
757
+ break;
758
+ case SWITCHTEC_IOCTL_PART_IMG0:
759
+ set_fw_info_part(info, &fi->img0);
760
+ if (ioread8(&af->img) == SWITCHTEC_GEN4_IMG0_ACTIVE)
761
+ info->active |= SWITCHTEC_IOCTL_PART_ACTIVE;
762
+ if (ioread16(&si->img_running) == SWITCHTEC_GEN4_IMG0_RUNNING)
763
+ info->active |= SWITCHTEC_IOCTL_PART_RUNNING;
764
+ break;
765
+ case SWITCHTEC_IOCTL_PART_IMG1:
766
+ set_fw_info_part(info, &fi->img1);
767
+ if (ioread8(&af->img) == SWITCHTEC_GEN4_IMG1_ACTIVE)
768
+ info->active |= SWITCHTEC_IOCTL_PART_ACTIVE;
769
+ if (ioread16(&si->img_running) == SWITCHTEC_GEN4_IMG1_RUNNING)
770
+ info->active |= SWITCHTEC_IOCTL_PART_RUNNING;
771
+ break;
772
+ case SWITCHTEC_IOCTL_PART_NVLOG:
773
+ set_fw_info_part(info, &fi->nvlog);
774
+ break;
775
+ case SWITCHTEC_IOCTL_PART_VENDOR0:
776
+ set_fw_info_part(info, &fi->vendor[0]);
777
+ break;
778
+ case SWITCHTEC_IOCTL_PART_VENDOR1:
779
+ set_fw_info_part(info, &fi->vendor[1]);
780
+ break;
781
+ case SWITCHTEC_IOCTL_PART_VENDOR2:
782
+ set_fw_info_part(info, &fi->vendor[2]);
783
+ break;
784
+ case SWITCHTEC_IOCTL_PART_VENDOR3:
785
+ set_fw_info_part(info, &fi->vendor[3]);
786
+ break;
787
+ case SWITCHTEC_IOCTL_PART_VENDOR4:
788
+ set_fw_info_part(info, &fi->vendor[4]);
789
+ break;
790
+ case SWITCHTEC_IOCTL_PART_VENDOR5:
791
+ set_fw_info_part(info, &fi->vendor[5]);
792
+ break;
793
+ case SWITCHTEC_IOCTL_PART_VENDOR6:
794
+ set_fw_info_part(info, &fi->vendor[6]);
795
+ break;
796
+ case SWITCHTEC_IOCTL_PART_VENDOR7:
797
+ set_fw_info_part(info, &fi->vendor[7]);
798
+ break;
799
+ default:
800
+ return -EINVAL;
801
+ }
802
+
803
+ return 0;
804
+}
805
+
806
+static int ioctl_flash_part_info(struct switchtec_dev *stdev,
807
+ struct switchtec_ioctl_flash_part_info __user *uinfo)
808
+{
809
+ int ret;
810
+ struct switchtec_ioctl_flash_part_info info = {0};
811
+
812
+ if (copy_from_user(&info, uinfo, sizeof(info)))
813
+ return -EFAULT;
814
+
815
+ if (stdev->gen == SWITCHTEC_GEN3) {
816
+ ret = flash_part_info_gen3(stdev, &info);
817
+ if (ret)
818
+ return ret;
819
+ } else if (stdev->gen == SWITCHTEC_GEN4) {
820
+ ret = flash_part_info_gen4(stdev, &info);
821
+ if (ret)
822
+ return ret;
823
+ } else {
824
+ return -ENOTSUPP;
825
+ }
616826
617827 if (copy_to_user(uinfo, &info, sizeof(info)))
618828 return -EFAULT;
....@@ -622,36 +832,42 @@
622832
623833 static int ioctl_event_summary(struct switchtec_dev *stdev,
624834 struct switchtec_user *stuser,
625
- struct switchtec_ioctl_event_summary __user *usum)
835
+ struct switchtec_ioctl_event_summary __user *usum,
836
+ size_t size)
626837 {
627
- struct switchtec_ioctl_event_summary s = {0};
838
+ struct switchtec_ioctl_event_summary *s;
628839 int i;
629840 u32 reg;
841
+ int ret = 0;
630842
631
- s.global = ioread32(&stdev->mmio_sw_event->global_summary);
632
- s.part_bitmap = readq(&stdev->mmio_sw_event->part_event_bitmap);
633
- s.local_part = ioread32(&stdev->mmio_part_cfg->part_event_summary);
843
+ s = kzalloc(sizeof(*s), GFP_KERNEL);
844
+ if (!s)
845
+ return -ENOMEM;
846
+
847
+ s->global = ioread32(&stdev->mmio_sw_event->global_summary);
848
+ s->part_bitmap = ioread64(&stdev->mmio_sw_event->part_event_bitmap);
849
+ s->local_part = ioread32(&stdev->mmio_part_cfg->part_event_summary);
634850
635851 for (i = 0; i < stdev->partition_count; i++) {
636852 reg = ioread32(&stdev->mmio_part_cfg_all[i].part_event_summary);
637
- s.part[i] = reg;
853
+ s->part[i] = reg;
638854 }
639855
640
- for (i = 0; i < SWITCHTEC_MAX_PFF_CSR; i++) {
641
- reg = ioread16(&stdev->mmio_pff_csr[i].vendor_id);
642
- if (reg != PCI_VENDOR_ID_MICROSEMI)
643
- break;
644
-
856
+ for (i = 0; i < stdev->pff_csr_count; i++) {
645857 reg = ioread32(&stdev->mmio_pff_csr[i].pff_event_summary);
646
- s.pff[i] = reg;
858
+ s->pff[i] = reg;
647859 }
648860
649
- if (copy_to_user(usum, &s, sizeof(s)))
650
- return -EFAULT;
861
+ if (copy_to_user(usum, s, size)) {
862
+ ret = -EFAULT;
863
+ goto error_case;
864
+ }
651865
652866 stuser->event_cnt = atomic_read(&stdev->event_cnt);
653867
654
- return 0;
868
+error_case:
869
+ kfree(s);
870
+ return ret;
655871 }
656872
657873 static u32 __iomem *global_ev_reg(struct switchtec_dev *stdev,
....@@ -701,10 +917,13 @@
701917 EV_PAR(SWITCHTEC_IOCTL_EVENT_MRPC_COMP, mrpc_comp_hdr),
702918 EV_PAR(SWITCHTEC_IOCTL_EVENT_MRPC_COMP_ASYNC, mrpc_comp_async_hdr),
703919 EV_PAR(SWITCHTEC_IOCTL_EVENT_DYN_PART_BIND_COMP, dyn_binding_hdr),
920
+ EV_PAR(SWITCHTEC_IOCTL_EVENT_INTERCOMM_REQ_NOTIFY,
921
+ intercomm_notify_hdr),
704922 EV_PFF(SWITCHTEC_IOCTL_EVENT_AER_IN_P2P, aer_in_p2p_hdr),
705923 EV_PFF(SWITCHTEC_IOCTL_EVENT_AER_IN_VEP, aer_in_vep_hdr),
706924 EV_PFF(SWITCHTEC_IOCTL_EVENT_DPC, dpc_hdr),
707925 EV_PFF(SWITCHTEC_IOCTL_EVENT_CTS, cts_hdr),
926
+ EV_PFF(SWITCHTEC_IOCTL_EVENT_UEC, uec_hdr),
708927 EV_PFF(SWITCHTEC_IOCTL_EVENT_HOTPLUG, hotplug_hdr),
709928 EV_PFF(SWITCHTEC_IOCTL_EVENT_IER, ier_hdr),
710929 EV_PFF(SWITCHTEC_IOCTL_EVENT_THRESH, threshold_hdr),
....@@ -721,7 +940,7 @@
721940 size_t off;
722941
723942 if (event_id < 0 || event_id >= SWITCHTEC_IOCTL_MAX_EVENTS)
724
- return ERR_PTR(-EINVAL);
943
+ return (u32 __iomem *)ERR_PTR(-EINVAL);
725944
726945 off = event_regs[event_id].offset;
727946
....@@ -729,10 +948,10 @@
729948 if (index == SWITCHTEC_IOCTL_EVENT_LOCAL_PART_IDX)
730949 index = stdev->partition;
731950 else if (index < 0 || index >= stdev->partition_count)
732
- return ERR_PTR(-EINVAL);
951
+ return (u32 __iomem *)ERR_PTR(-EINVAL);
733952 } else if (event_regs[event_id].map_reg == pff_ev_reg) {
734953 if (index < 0 || index >= stdev->pff_csr_count)
735
- return ERR_PTR(-EINVAL);
954
+ return (u32 __iomem *)ERR_PTR(-EINVAL);
736955 }
737956
738957 return event_regs[event_id].map_reg(stdev, off, index);
....@@ -838,11 +1057,11 @@
8381057 }
8391058
8401059 static int ioctl_pff_to_port(struct switchtec_dev *stdev,
841
- struct switchtec_ioctl_pff_port *up)
1060
+ struct switchtec_ioctl_pff_port __user *up)
8421061 {
8431062 int i, part;
8441063 u32 reg;
845
- struct part_cfg_regs *pcfg;
1064
+ struct part_cfg_regs __iomem *pcfg;
8461065 struct switchtec_ioctl_pff_port p;
8471066
8481067 if (copy_from_user(&p, up, sizeof(p)))
....@@ -885,10 +1104,10 @@
8851104 }
8861105
8871106 static int ioctl_port_to_pff(struct switchtec_dev *stdev,
888
- struct switchtec_ioctl_pff_port *up)
1107
+ struct switchtec_ioctl_pff_port __user *up)
8891108 {
8901109 struct switchtec_ioctl_pff_port p;
891
- struct part_cfg_regs *pcfg;
1110
+ struct part_cfg_regs __iomem *pcfg;
8921111
8931112 if (copy_from_user(&p, up, sizeof(p)))
8941113 return -EFAULT;
....@@ -941,8 +1160,9 @@
9411160 case SWITCHTEC_IOCTL_FLASH_PART_INFO:
9421161 rc = ioctl_flash_part_info(stdev, argp);
9431162 break;
944
- case SWITCHTEC_IOCTL_EVENT_SUMMARY:
945
- rc = ioctl_event_summary(stdev, stuser, argp);
1163
+ case SWITCHTEC_IOCTL_EVENT_SUMMARY_LEGACY:
1164
+ rc = ioctl_event_summary(stdev, stuser, argp,
1165
+ sizeof(struct switchtec_ioctl_event_summary_legacy));
9461166 break;
9471167 case SWITCHTEC_IOCTL_EVENT_CTL:
9481168 rc = ioctl_event_ctl(stdev, argp);
....@@ -952,6 +1172,10 @@
9521172 break;
9531173 case SWITCHTEC_IOCTL_PORT_TO_PFF:
9541174 rc = ioctl_port_to_pff(stdev, argp);
1175
+ break;
1176
+ case SWITCHTEC_IOCTL_EVENT_SUMMARY:
1177
+ rc = ioctl_event_summary(stdev, stuser, argp,
1178
+ sizeof(struct switchtec_ioctl_event_summary));
9551179 break;
9561180 default:
9571181 rc = -ENOTTY;
....@@ -970,7 +1194,7 @@
9701194 .read = switchtec_dev_read,
9711195 .poll = switchtec_dev_poll,
9721196 .unlocked_ioctl = switchtec_dev_ioctl,
973
- .compat_ioctl = switchtec_dev_ioctl,
1197
+ .compat_ioctl = compat_ptr_ioctl,
9741198 };
9751199
9761200 static void link_event_work(struct work_struct *work)
....@@ -1016,10 +1240,24 @@
10161240 }
10171241 }
10181242
1243
+static void enable_dma_mrpc(struct switchtec_dev *stdev)
1244
+{
1245
+ writeq(stdev->dma_mrpc_dma_addr, &stdev->mmio_mrpc->dma_addr);
1246
+ flush_wc_buf(stdev);
1247
+ iowrite32(SWITCHTEC_DMA_MRPC_EN, &stdev->mmio_mrpc->dma_en);
1248
+}
1249
+
10191250 static void stdev_release(struct device *dev)
10201251 {
10211252 struct switchtec_dev *stdev = to_stdev(dev);
10221253
1254
+ if (stdev->dma_mrpc) {
1255
+ iowrite32(0, &stdev->mmio_mrpc->dma_en);
1256
+ flush_wc_buf(stdev);
1257
+ writeq(0, &stdev->mmio_mrpc->dma_addr);
1258
+ dma_free_coherent(&stdev->pdev->dev, sizeof(*stdev->dma_mrpc),
1259
+ stdev->dma_mrpc, stdev->dma_mrpc_dma_addr);
1260
+ }
10231261 kfree(stdev);
10241262 }
10251263
....@@ -1037,7 +1275,8 @@
10371275
10381276 /* Wake up and kill any users waiting on an MRPC request */
10391277 list_for_each_entry_safe(stuser, tmpuser, &stdev->mrpc_queue, list) {
1040
- complete_all(&stuser->comp);
1278
+ stuser->cmd_done = true;
1279
+ wake_up_interruptible(&stuser->cmd_comp);
10411280 list_del_init(&stuser->list);
10421281 stuser_put(stuser);
10431282 }
....@@ -1112,10 +1351,6 @@
11121351 if (!(hdr & SWITCHTEC_EVENT_OCCURRED && hdr & SWITCHTEC_EVENT_EN_IRQ))
11131352 return 0;
11141353
1115
- if (eid == SWITCHTEC_IOCTL_EVENT_LINK_STATE ||
1116
- eid == SWITCHTEC_IOCTL_EVENT_MRPC_COMP)
1117
- return 0;
1118
-
11191354 dev_dbg(&stdev->dev, "%s: %d %d %x\n", __func__, eid, idx, hdr);
11201355 hdr &= ~(SWITCHTEC_EVENT_EN_IRQ | SWITCHTEC_EVENT_OCCURRED);
11211356 iowrite32(hdr, hdr_reg);
....@@ -1162,8 +1397,13 @@
11621397
11631398 check_link_state_events(stdev);
11641399
1165
- for (eid = 0; eid < SWITCHTEC_IOCTL_MAX_EVENTS; eid++)
1400
+ for (eid = 0; eid < SWITCHTEC_IOCTL_MAX_EVENTS; eid++) {
1401
+ if (eid == SWITCHTEC_IOCTL_EVENT_LINK_STATE ||
1402
+ eid == SWITCHTEC_IOCTL_EVENT_MRPC_COMP)
1403
+ continue;
1404
+
11661405 event_count += mask_all_events(stdev, eid);
1406
+ }
11671407
11681408 if (event_count) {
11691409 atomic_inc(&stdev->event_cnt);
....@@ -1176,13 +1416,34 @@
11761416 return ret;
11771417 }
11781418
1419
+
1420
+static irqreturn_t switchtec_dma_mrpc_isr(int irq, void *dev)
1421
+{
1422
+ struct switchtec_dev *stdev = dev;
1423
+ irqreturn_t ret = IRQ_NONE;
1424
+
1425
+ iowrite32(SWITCHTEC_EVENT_CLEAR |
1426
+ SWITCHTEC_EVENT_EN_IRQ,
1427
+ &stdev->mmio_part_cfg->mrpc_comp_hdr);
1428
+ schedule_work(&stdev->mrpc_work);
1429
+
1430
+ ret = IRQ_HANDLED;
1431
+ return ret;
1432
+}
1433
+
11791434 static int switchtec_init_isr(struct switchtec_dev *stdev)
11801435 {
11811436 int nvecs;
11821437 int event_irq;
1438
+ int dma_mrpc_irq;
1439
+ int rc;
11831440
1184
- nvecs = pci_alloc_irq_vectors(stdev->pdev, 1, 4,
1185
- PCI_IRQ_MSIX | PCI_IRQ_MSI);
1441
+ if (nirqs < 4)
1442
+ nirqs = 4;
1443
+
1444
+ nvecs = pci_alloc_irq_vectors(stdev->pdev, 1, nirqs,
1445
+ PCI_IRQ_MSIX | PCI_IRQ_MSI |
1446
+ PCI_IRQ_VIRTUAL);
11861447 if (nvecs < 0)
11871448 return nvecs;
11881449
....@@ -1194,16 +1455,36 @@
11941455 if (event_irq < 0)
11951456 return event_irq;
11961457
1197
- return devm_request_irq(&stdev->pdev->dev, event_irq,
1458
+ rc = devm_request_irq(&stdev->pdev->dev, event_irq,
11981459 switchtec_event_isr, 0,
11991460 KBUILD_MODNAME, stdev);
1461
+
1462
+ if (rc)
1463
+ return rc;
1464
+
1465
+ if (!stdev->dma_mrpc)
1466
+ return rc;
1467
+
1468
+ dma_mrpc_irq = ioread32(&stdev->mmio_mrpc->dma_vector);
1469
+ if (dma_mrpc_irq < 0 || dma_mrpc_irq >= nvecs)
1470
+ return -EFAULT;
1471
+
1472
+ dma_mrpc_irq = pci_irq_vector(stdev->pdev, dma_mrpc_irq);
1473
+ if (dma_mrpc_irq < 0)
1474
+ return dma_mrpc_irq;
1475
+
1476
+ rc = devm_request_irq(&stdev->pdev->dev, dma_mrpc_irq,
1477
+ switchtec_dma_mrpc_isr, 0,
1478
+ KBUILD_MODNAME, stdev);
1479
+
1480
+ return rc;
12001481 }
12011482
12021483 static void init_pff(struct switchtec_dev *stdev)
12031484 {
12041485 int i;
12051486 u32 reg;
1206
- struct part_cfg_regs *pcfg = stdev->mmio_part_cfg;
1487
+ struct part_cfg_regs __iomem *pcfg = stdev->mmio_part_cfg;
12071488
12081489 for (i = 0; i < SWITCHTEC_MAX_PFF_CSR; i++) {
12091490 reg = ioread16(&stdev->mmio_pff_csr[i].vendor_id);
....@@ -1214,16 +1495,16 @@
12141495 stdev->pff_csr_count = i;
12151496
12161497 reg = ioread32(&pcfg->usp_pff_inst_id);
1217
- if (reg < SWITCHTEC_MAX_PFF_CSR)
1498
+ if (reg < stdev->pff_csr_count)
12181499 stdev->pff_local[reg] = 1;
12191500
12201501 reg = ioread32(&pcfg->vep_pff_inst_id);
1221
- if (reg < SWITCHTEC_MAX_PFF_CSR)
1502
+ if (reg < stdev->pff_csr_count)
12221503 stdev->pff_local[reg] = 1;
12231504
12241505 for (i = 0; i < ARRAY_SIZE(pcfg->dsp_pff_inst_id); i++) {
12251506 reg = ioread32(&pcfg->dsp_pff_inst_id[i]);
1226
- if (reg < SWITCHTEC_MAX_PFF_CSR)
1507
+ if (reg < stdev->pff_csr_count)
12271508 stdev->pff_local[reg] = 1;
12281509 }
12291510 }
....@@ -1232,24 +1513,52 @@
12321513 struct pci_dev *pdev)
12331514 {
12341515 int rc;
1516
+ void __iomem *map;
1517
+ unsigned long res_start, res_len;
1518
+ u32 __iomem *part_id;
12351519
12361520 rc = pcim_enable_device(pdev);
12371521 if (rc)
12381522 return rc;
12391523
1240
- rc = pcim_iomap_regions(pdev, 0x1, KBUILD_MODNAME);
1524
+ rc = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
12411525 if (rc)
12421526 return rc;
12431527
12441528 pci_set_master(pdev);
12451529
1246
- stdev->mmio = pcim_iomap_table(pdev)[0];
1247
- stdev->mmio_mrpc = stdev->mmio + SWITCHTEC_GAS_MRPC_OFFSET;
1530
+ res_start = pci_resource_start(pdev, 0);
1531
+ res_len = pci_resource_len(pdev, 0);
1532
+
1533
+ if (!devm_request_mem_region(&pdev->dev, res_start,
1534
+ res_len, KBUILD_MODNAME))
1535
+ return -EBUSY;
1536
+
1537
+ stdev->mmio_mrpc = devm_ioremap_wc(&pdev->dev, res_start,
1538
+ SWITCHTEC_GAS_TOP_CFG_OFFSET);
1539
+ if (!stdev->mmio_mrpc)
1540
+ return -ENOMEM;
1541
+
1542
+ map = devm_ioremap(&pdev->dev,
1543
+ res_start + SWITCHTEC_GAS_TOP_CFG_OFFSET,
1544
+ res_len - SWITCHTEC_GAS_TOP_CFG_OFFSET);
1545
+ if (!map)
1546
+ return -ENOMEM;
1547
+
1548
+ stdev->mmio = map - SWITCHTEC_GAS_TOP_CFG_OFFSET;
12481549 stdev->mmio_sw_event = stdev->mmio + SWITCHTEC_GAS_SW_EVENT_OFFSET;
12491550 stdev->mmio_sys_info = stdev->mmio + SWITCHTEC_GAS_SYS_INFO_OFFSET;
12501551 stdev->mmio_flash_info = stdev->mmio + SWITCHTEC_GAS_FLASH_INFO_OFFSET;
12511552 stdev->mmio_ntb = stdev->mmio + SWITCHTEC_GAS_NTB_OFFSET;
1252
- stdev->partition = ioread8(&stdev->mmio_sys_info->partition_id);
1553
+
1554
+ if (stdev->gen == SWITCHTEC_GEN3)
1555
+ part_id = &stdev->mmio_sys_info->gen3.partition_id;
1556
+ else if (stdev->gen == SWITCHTEC_GEN4)
1557
+ part_id = &stdev->mmio_sys_info->gen4.partition_id;
1558
+ else
1559
+ return -ENOTSUPP;
1560
+
1561
+ stdev->partition = ioread8(part_id);
12531562 stdev->partition_count = ioread8(&stdev->mmio_ntb->partition_count);
12541563 stdev->mmio_part_cfg_all = stdev->mmio + SWITCHTEC_GAS_PART_CFG_OFFSET;
12551564 stdev->mmio_part_cfg = &stdev->mmio_part_cfg_all[stdev->partition];
....@@ -1261,6 +1570,19 @@
12611570 init_pff(stdev);
12621571
12631572 pci_set_drvdata(pdev, stdev);
1573
+
1574
+ if (!use_dma_mrpc)
1575
+ return 0;
1576
+
1577
+ if (ioread32(&stdev->mmio_mrpc->dma_ver) == 0)
1578
+ return 0;
1579
+
1580
+ stdev->dma_mrpc = dma_alloc_coherent(&stdev->pdev->dev,
1581
+ sizeof(*stdev->dma_mrpc),
1582
+ &stdev->dma_mrpc_dma_addr,
1583
+ GFP_KERNEL);
1584
+ if (stdev->dma_mrpc == NULL)
1585
+ return -ENOMEM;
12641586
12651587 return 0;
12661588 }
....@@ -1278,6 +1600,8 @@
12781600 if (IS_ERR(stdev))
12791601 return PTR_ERR(stdev);
12801602
1603
+ stdev->gen = id->driver_data;
1604
+
12811605 rc = switchtec_init_pci(stdev, pdev);
12821606 if (rc)
12831607 goto err_put;
....@@ -1292,6 +1616,9 @@
12921616 SWITCHTEC_EVENT_EN_IRQ,
12931617 &stdev->mmio_part_cfg->mrpc_comp_hdr);
12941618 enable_link_state_events(stdev);
1619
+
1620
+ if (stdev->dma_mrpc)
1621
+ enable_dma_mrpc(stdev);
12951622
12961623 rc = cdev_device_add(&stdev->cdev, &stdev->dev);
12971624 if (rc)
....@@ -1318,12 +1645,11 @@
13181645 cdev_device_del(&stdev->cdev, &stdev->dev);
13191646 ida_simple_remove(&switchtec_minor_ida, MINOR(stdev->dev.devt));
13201647 dev_info(&stdev->dev, "unregistered.\n");
1321
-
13221648 stdev_kill(stdev);
13231649 put_device(&stdev->dev);
13241650 }
13251651
1326
-#define SWITCHTEC_PCI_DEVICE(device_id) \
1652
+#define SWITCHTEC_PCI_DEVICE(device_id, gen) \
13271653 { \
13281654 .vendor = PCI_VENDOR_ID_MICROSEMI, \
13291655 .device = device_id, \
....@@ -1331,6 +1657,7 @@
13311657 .subdevice = PCI_ANY_ID, \
13321658 .class = (PCI_CLASS_MEMORY_OTHER << 8), \
13331659 .class_mask = 0xFFFFFFFF, \
1660
+ .driver_data = gen, \
13341661 }, \
13351662 { \
13361663 .vendor = PCI_VENDOR_ID_MICROSEMI, \
....@@ -1339,39 +1666,58 @@
13391666 .subdevice = PCI_ANY_ID, \
13401667 .class = (PCI_CLASS_BRIDGE_OTHER << 8), \
13411668 .class_mask = 0xFFFFFFFF, \
1669
+ .driver_data = gen, \
13421670 }
13431671
13441672 static const struct pci_device_id switchtec_pci_tbl[] = {
1345
- SWITCHTEC_PCI_DEVICE(0x8531), //PFX 24xG3
1346
- SWITCHTEC_PCI_DEVICE(0x8532), //PFX 32xG3
1347
- SWITCHTEC_PCI_DEVICE(0x8533), //PFX 48xG3
1348
- SWITCHTEC_PCI_DEVICE(0x8534), //PFX 64xG3
1349
- SWITCHTEC_PCI_DEVICE(0x8535), //PFX 80xG3
1350
- SWITCHTEC_PCI_DEVICE(0x8536), //PFX 96xG3
1351
- SWITCHTEC_PCI_DEVICE(0x8541), //PSX 24xG3
1352
- SWITCHTEC_PCI_DEVICE(0x8542), //PSX 32xG3
1353
- SWITCHTEC_PCI_DEVICE(0x8543), //PSX 48xG3
1354
- SWITCHTEC_PCI_DEVICE(0x8544), //PSX 64xG3
1355
- SWITCHTEC_PCI_DEVICE(0x8545), //PSX 80xG3
1356
- SWITCHTEC_PCI_DEVICE(0x8546), //PSX 96xG3
1357
- SWITCHTEC_PCI_DEVICE(0x8551), //PAX 24XG3
1358
- SWITCHTEC_PCI_DEVICE(0x8552), //PAX 32XG3
1359
- SWITCHTEC_PCI_DEVICE(0x8553), //PAX 48XG3
1360
- SWITCHTEC_PCI_DEVICE(0x8554), //PAX 64XG3
1361
- SWITCHTEC_PCI_DEVICE(0x8555), //PAX 80XG3
1362
- SWITCHTEC_PCI_DEVICE(0x8556), //PAX 96XG3
1363
- SWITCHTEC_PCI_DEVICE(0x8561), //PFXL 24XG3
1364
- SWITCHTEC_PCI_DEVICE(0x8562), //PFXL 32XG3
1365
- SWITCHTEC_PCI_DEVICE(0x8563), //PFXL 48XG3
1366
- SWITCHTEC_PCI_DEVICE(0x8564), //PFXL 64XG3
1367
- SWITCHTEC_PCI_DEVICE(0x8565), //PFXL 80XG3
1368
- SWITCHTEC_PCI_DEVICE(0x8566), //PFXL 96XG3
1369
- SWITCHTEC_PCI_DEVICE(0x8571), //PFXI 24XG3
1370
- SWITCHTEC_PCI_DEVICE(0x8572), //PFXI 32XG3
1371
- SWITCHTEC_PCI_DEVICE(0x8573), //PFXI 48XG3
1372
- SWITCHTEC_PCI_DEVICE(0x8574), //PFXI 64XG3
1373
- SWITCHTEC_PCI_DEVICE(0x8575), //PFXI 80XG3
1374
- SWITCHTEC_PCI_DEVICE(0x8576), //PFXI 96XG3
1673
+ SWITCHTEC_PCI_DEVICE(0x8531, SWITCHTEC_GEN3), //PFX 24xG3
1674
+ SWITCHTEC_PCI_DEVICE(0x8532, SWITCHTEC_GEN3), //PFX 32xG3
1675
+ SWITCHTEC_PCI_DEVICE(0x8533, SWITCHTEC_GEN3), //PFX 48xG3
1676
+ SWITCHTEC_PCI_DEVICE(0x8534, SWITCHTEC_GEN3), //PFX 64xG3
1677
+ SWITCHTEC_PCI_DEVICE(0x8535, SWITCHTEC_GEN3), //PFX 80xG3
1678
+ SWITCHTEC_PCI_DEVICE(0x8536, SWITCHTEC_GEN3), //PFX 96xG3
1679
+ SWITCHTEC_PCI_DEVICE(0x8541, SWITCHTEC_GEN3), //PSX 24xG3
1680
+ SWITCHTEC_PCI_DEVICE(0x8542, SWITCHTEC_GEN3), //PSX 32xG3
1681
+ SWITCHTEC_PCI_DEVICE(0x8543, SWITCHTEC_GEN3), //PSX 48xG3
1682
+ SWITCHTEC_PCI_DEVICE(0x8544, SWITCHTEC_GEN3), //PSX 64xG3
1683
+ SWITCHTEC_PCI_DEVICE(0x8545, SWITCHTEC_GEN3), //PSX 80xG3
1684
+ SWITCHTEC_PCI_DEVICE(0x8546, SWITCHTEC_GEN3), //PSX 96xG3
1685
+ SWITCHTEC_PCI_DEVICE(0x8551, SWITCHTEC_GEN3), //PAX 24XG3
1686
+ SWITCHTEC_PCI_DEVICE(0x8552, SWITCHTEC_GEN3), //PAX 32XG3
1687
+ SWITCHTEC_PCI_DEVICE(0x8553, SWITCHTEC_GEN3), //PAX 48XG3
1688
+ SWITCHTEC_PCI_DEVICE(0x8554, SWITCHTEC_GEN3), //PAX 64XG3
1689
+ SWITCHTEC_PCI_DEVICE(0x8555, SWITCHTEC_GEN3), //PAX 80XG3
1690
+ SWITCHTEC_PCI_DEVICE(0x8556, SWITCHTEC_GEN3), //PAX 96XG3
1691
+ SWITCHTEC_PCI_DEVICE(0x8561, SWITCHTEC_GEN3), //PFXL 24XG3
1692
+ SWITCHTEC_PCI_DEVICE(0x8562, SWITCHTEC_GEN3), //PFXL 32XG3
1693
+ SWITCHTEC_PCI_DEVICE(0x8563, SWITCHTEC_GEN3), //PFXL 48XG3
1694
+ SWITCHTEC_PCI_DEVICE(0x8564, SWITCHTEC_GEN3), //PFXL 64XG3
1695
+ SWITCHTEC_PCI_DEVICE(0x8565, SWITCHTEC_GEN3), //PFXL 80XG3
1696
+ SWITCHTEC_PCI_DEVICE(0x8566, SWITCHTEC_GEN3), //PFXL 96XG3
1697
+ SWITCHTEC_PCI_DEVICE(0x8571, SWITCHTEC_GEN3), //PFXI 24XG3
1698
+ SWITCHTEC_PCI_DEVICE(0x8572, SWITCHTEC_GEN3), //PFXI 32XG3
1699
+ SWITCHTEC_PCI_DEVICE(0x8573, SWITCHTEC_GEN3), //PFXI 48XG3
1700
+ SWITCHTEC_PCI_DEVICE(0x8574, SWITCHTEC_GEN3), //PFXI 64XG3
1701
+ SWITCHTEC_PCI_DEVICE(0x8575, SWITCHTEC_GEN3), //PFXI 80XG3
1702
+ SWITCHTEC_PCI_DEVICE(0x8576, SWITCHTEC_GEN3), //PFXI 96XG3
1703
+ SWITCHTEC_PCI_DEVICE(0x4000, SWITCHTEC_GEN4), //PFX 100XG4
1704
+ SWITCHTEC_PCI_DEVICE(0x4084, SWITCHTEC_GEN4), //PFX 84XG4
1705
+ SWITCHTEC_PCI_DEVICE(0x4068, SWITCHTEC_GEN4), //PFX 68XG4
1706
+ SWITCHTEC_PCI_DEVICE(0x4052, SWITCHTEC_GEN4), //PFX 52XG4
1707
+ SWITCHTEC_PCI_DEVICE(0x4036, SWITCHTEC_GEN4), //PFX 36XG4
1708
+ SWITCHTEC_PCI_DEVICE(0x4028, SWITCHTEC_GEN4), //PFX 28XG4
1709
+ SWITCHTEC_PCI_DEVICE(0x4100, SWITCHTEC_GEN4), //PSX 100XG4
1710
+ SWITCHTEC_PCI_DEVICE(0x4184, SWITCHTEC_GEN4), //PSX 84XG4
1711
+ SWITCHTEC_PCI_DEVICE(0x4168, SWITCHTEC_GEN4), //PSX 68XG4
1712
+ SWITCHTEC_PCI_DEVICE(0x4152, SWITCHTEC_GEN4), //PSX 52XG4
1713
+ SWITCHTEC_PCI_DEVICE(0x4136, SWITCHTEC_GEN4), //PSX 36XG4
1714
+ SWITCHTEC_PCI_DEVICE(0x4128, SWITCHTEC_GEN4), //PSX 28XG4
1715
+ SWITCHTEC_PCI_DEVICE(0x4200, SWITCHTEC_GEN4), //PAX 100XG4
1716
+ SWITCHTEC_PCI_DEVICE(0x4284, SWITCHTEC_GEN4), //PAX 84XG4
1717
+ SWITCHTEC_PCI_DEVICE(0x4268, SWITCHTEC_GEN4), //PAX 68XG4
1718
+ SWITCHTEC_PCI_DEVICE(0x4252, SWITCHTEC_GEN4), //PAX 52XG4
1719
+ SWITCHTEC_PCI_DEVICE(0x4236, SWITCHTEC_GEN4), //PAX 36XG4
1720
+ SWITCHTEC_PCI_DEVICE(0x4228, SWITCHTEC_GEN4), //PAX 28XG4
13751721 {0}
13761722 };
13771723 MODULE_DEVICE_TABLE(pci, switchtec_pci_tbl);