[PATCH 3/6] Staging: vme: Allow override of geographical address on ca91c142

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Geographical addressing only works if the VME backplane supports it. There
are a large number of old backplanes which do not support geographical
addressing. These boards will generally report a slot ID of zero - which is
an invalid ID in the slot numbering scheme.

Allow the geographical address to be over-ridden on the ca91c142 so that a
slot ID can be provided manually in these circumstances.

Signed-off-by: Martyn Welch <martyn.welch@xxxxxxxxxxx>
---

 drivers/staging/vme/bridges/vme_ca91cx42.c |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/vme/bridges/vme_ca91cx42.c b/drivers/staging/vme/bridges/vme_ca91cx42.c
index 1cf3e91..5799b09 100644
--- a/drivers/staging/vme/bridges/vme_ca91cx42.c
+++ b/drivers/staging/vme/bridges/vme_ca91cx42.c
@@ -38,6 +38,9 @@ static int ca91cx42_probe(struct pci_dev *, const struct pci_device_id *);
 static void ca91cx42_remove(struct pci_dev *);
 static void __exit ca91cx42_exit(void);
 
+/* Module parameters */
+static int geoid;
+
 struct vme_bridge *ca91cx42_bridge;
 wait_queue_head_t dma_queue;
 wait_queue_head_t iack_queue;
@@ -881,8 +884,12 @@ int ca91cx42_slot_get(void)
 {
 	u32 slot = 0;
 
-	slot = ioread32(ca91cx42_bridge->base + VCSR_BS);
-	slot = ((slot & CA91CX42_VCSR_BS_SLOT_M) >> 27);
+	if (!geoid) {
+		slot = ioread32(ca91cx42_bridge->base + VCSR_BS);
+		slot = ((slot & CA91CX42_VCSR_BS_SLOT_M) >> 27);
+	} else
+		slot = geoid;
+
 	return (int)slot;
 
 }
@@ -1299,6 +1306,9 @@ static void __exit ca91cx42_exit(void)
 	pci_unregister_driver(&ca91cx42_driver);
 }
 
+MODULE_PARM_DESC(geoid, "Override geographical addressing");
+module_param(geoid, int, 0);
+
 MODULE_DESCRIPTION("VME driver for the Tundra Universe II VME bridge");
 MODULE_LICENSE("GPL");
 


--
Martyn Welch MEng MPhil MIET (Principal Software Engineer)   T:+44(0)1327322748
GE Fanuc Intelligent Platforms Ltd,        |Registered in England and Wales
Tove Valley Business Park, Towcester,      |(3828642) at 100 Barbirolli Square,
Northants, NN12 6PF, UK T:+44(0)1327359444 |Manchester,M2 3AB  VAT:GB 927559189
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel

[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux