aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/message/i2o
diff options
context:
space:
mode:
authorJonathan Herman <hermanjl@cs.unc.edu>2013-01-17 16:15:55 -0500
committerJonathan Herman <hermanjl@cs.unc.edu>2013-01-17 16:15:55 -0500
commit8dea78da5cee153b8af9c07a2745f6c55057fe12 (patch)
treea8f4d49d63b1ecc92f2fddceba0655b2472c5bd9 /drivers/message/i2o
parent406089d01562f1e2bf9f089fd7637009ebaad589 (diff)
Patched in Tegra support.
Diffstat (limited to 'drivers/message/i2o')
-rw-r--r--drivers/message/i2o/README.ioctl12
-rw-r--r--drivers/message/i2o/i2o_block.c2
-rw-r--r--drivers/message/i2o/i2o_config.c7
-rw-r--r--drivers/message/i2o/i2o_proc.c52
-rw-r--r--drivers/message/i2o/i2o_scsi.c1
-rw-r--r--drivers/message/i2o/pci.c12
6 files changed, 43 insertions, 43 deletions
diff --git a/drivers/message/i2o/README.ioctl b/drivers/message/i2o/README.ioctl
index 4a7d2ebdfc9..5fb195af43e 100644
--- a/drivers/message/i2o/README.ioctl
+++ b/drivers/message/i2o/README.ioctl
@@ -138,7 +138,7 @@ VI. Setting Parameters
138 138
139 The return value is the size in bytes of the data written into 139 The return value is the size in bytes of the data written into
140 ops->resbuf if no errors occur. If an error occurs, -1 is returned 140 ops->resbuf if no errors occur. If an error occurs, -1 is returned
141 and errno is set appropriately: 141 and errno is set appropriatly:
142 142
143 EFAULT Invalid user space pointer was passed 143 EFAULT Invalid user space pointer was passed
144 ENXIO Invalid IOP number 144 ENXIO Invalid IOP number
@@ -222,7 +222,7 @@ VIII. Downloading Software
222 RETURNS 222 RETURNS
223 223
224 This function returns 0 no errors occur. If an error occurs, -1 224 This function returns 0 no errors occur. If an error occurs, -1
225 is returned and errno is set appropriately: 225 is returned and errno is set appropriatly:
226 226
227 EFAULT Invalid user space pointer was passed 227 EFAULT Invalid user space pointer was passed
228 ENXIO Invalid IOP number 228 ENXIO Invalid IOP number
@@ -264,7 +264,7 @@ IX. Uploading Software
264 RETURNS 264 RETURNS
265 265
266 This function returns 0 if no errors occur. If an error occurs, -1 266 This function returns 0 if no errors occur. If an error occurs, -1
267 is returned and errno is set appropriately: 267 is returned and errno is set appropriatly:
268 268
269 EFAULT Invalid user space pointer was passed 269 EFAULT Invalid user space pointer was passed
270 ENXIO Invalid IOP number 270 ENXIO Invalid IOP number
@@ -301,7 +301,7 @@ X. Removing Software
301 RETURNS 301 RETURNS
302 302
303 This function returns 0 if no errors occur. If an error occurs, -1 303 This function returns 0 if no errors occur. If an error occurs, -1
304 is returned and errno is set appropriately: 304 is returned and errno is set appropriatly:
305 305
306 EFAULT Invalid user space pointer was passed 306 EFAULT Invalid user space pointer was passed
307 ENXIO Invalid IOP number 307 ENXIO Invalid IOP number
@@ -325,7 +325,7 @@ X. Validating Configuration
325 RETURNS 325 RETURNS
326 326
327 This function returns 0 if no erro occur. If an error occurs, -1 is 327 This function returns 0 if no erro occur. If an error occurs, -1 is
328 returned and errno is set appropriately: 328 returned and errno is set appropriatly:
329 329
330 ETIMEDOUT Timeout waiting for reply message 330 ETIMEDOUT Timeout waiting for reply message
331 ENXIO Invalid IOP number 331 ENXIO Invalid IOP number
@@ -360,7 +360,7 @@ XI. Configuration Dialog
360 RETURNS 360 RETURNS
361 361
362 This function returns 0 if no error occur. If an error occurs, -1 362 This function returns 0 if no error occur. If an error occurs, -1
363 is returned and errno is set appropriately: 363 is returned and errno is set appropriatly:
364 364
365 EFAULT Invalid user space pointer was passed 365 EFAULT Invalid user space pointer was passed
366 ENXIO Invalid IOP number 366 ENXIO Invalid IOP number
diff --git a/drivers/message/i2o/i2o_block.c b/drivers/message/i2o/i2o_block.c
index 49e86aed2bc..4796bbf0ae4 100644
--- a/drivers/message/i2o/i2o_block.c
+++ b/drivers/message/i2o/i2o_block.c
@@ -609,7 +609,7 @@ static int i2o_block_release(struct gendisk *disk, fmode_t mode)
609 u8 operation; 609 u8 operation;
610 610
611 /* 611 /*
612 * This is to deal with the case of an application 612 * This is to deail with the case of an application
613 * opening a device and then the device disappears while 613 * opening a device and then the device disappears while
614 * it's in use, and then the application tries to release 614 * it's in use, and then the application tries to release
615 * it. ex: Unmounting a deleted RAID volume at reboot. 615 * it. ex: Unmounting a deleted RAID volume at reboot.
diff --git a/drivers/message/i2o/i2o_config.c b/drivers/message/i2o/i2o_config.c
index 5451beff183..098de2b3578 100644
--- a/drivers/message/i2o/i2o_config.c
+++ b/drivers/message/i2o/i2o_config.c
@@ -188,13 +188,6 @@ static int i2o_cfg_parms(unsigned long arg, unsigned int type)
188 if (!dev) 188 if (!dev)
189 return -ENXIO; 189 return -ENXIO;
190 190
191 /*
192 * Stop users being able to try and allocate arbitrary amounts
193 * of DMA space. 64K is way more than sufficient for this.
194 */
195 if (kcmd.oplen > 65536)
196 return -EMSGSIZE;
197
198 ops = memdup_user(kcmd.opbuf, kcmd.oplen); 191 ops = memdup_user(kcmd.opbuf, kcmd.oplen);
199 if (IS_ERR(ops)) 192 if (IS_ERR(ops))
200 return PTR_ERR(ops); 193 return PTR_ERR(ops);
diff --git a/drivers/message/i2o/i2o_proc.c b/drivers/message/i2o/i2o_proc.c
index 8001aa6bfb4..07dbeaf9df9 100644
--- a/drivers/message/i2o/i2o_proc.c
+++ b/drivers/message/i2o/i2o_proc.c
@@ -56,7 +56,7 @@
56/* Structure used to define /proc entries */ 56/* Structure used to define /proc entries */
57typedef struct _i2o_proc_entry_t { 57typedef struct _i2o_proc_entry_t {
58 char *name; /* entry name */ 58 char *name; /* entry name */
59 umode_t mode; /* mode */ 59 mode_t mode; /* mode */
60 const struct file_operations *fops; /* open function */ 60 const struct file_operations *fops; /* open function */
61} i2o_proc_entry; 61} i2o_proc_entry;
62 62
@@ -255,8 +255,9 @@ static char *scsi_devices[] = {
255 "Array Controller Device" 255 "Array Controller Device"
256}; 256};
257 257
258static char *chtostr(char *tmp, u8 *chars, int n) 258static char *chtostr(u8 * chars, int n)
259{ 259{
260 char tmp[256];
260 tmp[0] = 0; 261 tmp[0] = 0;
261 return strncat(tmp, (char *)chars, n); 262 return strncat(tmp, (char *)chars, n);
262} 263}
@@ -282,6 +283,7 @@ static char *bus_strings[] = {
282 "Local Bus", 283 "Local Bus",
283 "ISA", 284 "ISA",
284 "EISA", 285 "EISA",
286 "MCA",
285 "PCI", 287 "PCI",
286 "PCMCIA", 288 "PCMCIA",
287 "NUBUS", 289 "NUBUS",
@@ -349,6 +351,18 @@ static int i2o_seq_show_hrt(struct seq_file *seq, void *v)
349 EisaSlotNumber); 351 EisaSlotNumber);
350 break; 352 break;
351 353
354 case I2O_BUS_MCA:
355 seq_printf(seq, " IOBase: %0#6x,",
356 hrt->hrt_entry[i].bus.mca_bus.
357 McaBaseIOPort);
358 seq_printf(seq, " MemoryBase: %0#10x,",
359 hrt->hrt_entry[i].bus.mca_bus.
360 McaBaseMemoryAddress);
361 seq_printf(seq, " Slot: %0#4x,",
362 hrt->hrt_entry[i].bus.mca_bus.
363 McaSlotNumber);
364 break;
365
352 case I2O_BUS_PCI: 366 case I2O_BUS_PCI:
353 seq_printf(seq, " Bus: %0#4x", 367 seq_printf(seq, " Bus: %0#4x",
354 hrt->hrt_entry[i].bus.pci_bus. 368 hrt->hrt_entry[i].bus.pci_bus.
@@ -790,7 +804,6 @@ static int i2o_seq_show_ddm_table(struct seq_file *seq, void *v)
790 } *result; 804 } *result;
791 805
792 i2o_exec_execute_ddm_table ddm_table; 806 i2o_exec_execute_ddm_table ddm_table;
793 char tmp[28 + 1];
794 807
795 result = kmalloc(sizeof(*result), GFP_KERNEL); 808 result = kmalloc(sizeof(*result), GFP_KERNEL);
796 if (!result) 809 if (!result)
@@ -826,7 +839,7 @@ static int i2o_seq_show_ddm_table(struct seq_file *seq, void *v)
826 seq_printf(seq, "%-#7x", ddm_table.i2o_vendor_id); 839 seq_printf(seq, "%-#7x", ddm_table.i2o_vendor_id);
827 seq_printf(seq, "%-#8x", ddm_table.module_id); 840 seq_printf(seq, "%-#8x", ddm_table.module_id);
828 seq_printf(seq, "%-29s", 841 seq_printf(seq, "%-29s",
829 chtostr(tmp, ddm_table.module_name_version, 28)); 842 chtostr(ddm_table.module_name_version, 28));
830 seq_printf(seq, "%9d ", ddm_table.data_size); 843 seq_printf(seq, "%9d ", ddm_table.data_size);
831 seq_printf(seq, "%8d", ddm_table.code_size); 844 seq_printf(seq, "%8d", ddm_table.code_size);
832 845
@@ -893,7 +906,6 @@ static int i2o_seq_show_drivers_stored(struct seq_file *seq, void *v)
893 906
894 i2o_driver_result_table *result; 907 i2o_driver_result_table *result;
895 i2o_driver_store_table *dst; 908 i2o_driver_store_table *dst;
896 char tmp[28 + 1];
897 909
898 result = kmalloc(sizeof(i2o_driver_result_table), GFP_KERNEL); 910 result = kmalloc(sizeof(i2o_driver_result_table), GFP_KERNEL);
899 if (result == NULL) 911 if (result == NULL)
@@ -928,9 +940,8 @@ static int i2o_seq_show_drivers_stored(struct seq_file *seq, void *v)
928 940
929 seq_printf(seq, "%-#7x", dst->i2o_vendor_id); 941 seq_printf(seq, "%-#7x", dst->i2o_vendor_id);
930 seq_printf(seq, "%-#8x", dst->module_id); 942 seq_printf(seq, "%-#8x", dst->module_id);
931 seq_printf(seq, "%-29s", 943 seq_printf(seq, "%-29s", chtostr(dst->module_name_version, 28));
932 chtostr(tmp, dst->module_name_version, 28)); 944 seq_printf(seq, "%-9s", chtostr(dst->date, 8));
933 seq_printf(seq, "%-9s", chtostr(tmp, dst->date, 8));
934 seq_printf(seq, "%8d ", dst->module_size); 945 seq_printf(seq, "%8d ", dst->module_size);
935 seq_printf(seq, "%8d ", dst->mpb_size); 946 seq_printf(seq, "%8d ", dst->mpb_size);
936 seq_printf(seq, "0x%04x", dst->module_flags); 947 seq_printf(seq, "0x%04x", dst->module_flags);
@@ -1250,7 +1261,6 @@ static int i2o_seq_show_dev_identity(struct seq_file *seq, void *v)
1250 // == (allow) 512d bytes (max) 1261 // == (allow) 512d bytes (max)
1251 static u16 *work16 = (u16 *) work32; 1262 static u16 *work16 = (u16 *) work32;
1252 int token; 1263 int token;
1253 char tmp[16 + 1];
1254 1264
1255 token = i2o_parm_field_get(d, 0xF100, -1, &work32, sizeof(work32)); 1265 token = i2o_parm_field_get(d, 0xF100, -1, &work32, sizeof(work32));
1256 1266
@@ -1263,13 +1273,13 @@ static int i2o_seq_show_dev_identity(struct seq_file *seq, void *v)
1263 seq_printf(seq, "Owner TID : %0#5x\n", work16[2]); 1273 seq_printf(seq, "Owner TID : %0#5x\n", work16[2]);
1264 seq_printf(seq, "Parent TID : %0#5x\n", work16[3]); 1274 seq_printf(seq, "Parent TID : %0#5x\n", work16[3]);
1265 seq_printf(seq, "Vendor info : %s\n", 1275 seq_printf(seq, "Vendor info : %s\n",
1266 chtostr(tmp, (u8 *) (work32 + 2), 16)); 1276 chtostr((u8 *) (work32 + 2), 16));
1267 seq_printf(seq, "Product info : %s\n", 1277 seq_printf(seq, "Product info : %s\n",
1268 chtostr(tmp, (u8 *) (work32 + 6), 16)); 1278 chtostr((u8 *) (work32 + 6), 16));
1269 seq_printf(seq, "Description : %s\n", 1279 seq_printf(seq, "Description : %s\n",
1270 chtostr(tmp, (u8 *) (work32 + 10), 16)); 1280 chtostr((u8 *) (work32 + 10), 16));
1271 seq_printf(seq, "Product rev. : %s\n", 1281 seq_printf(seq, "Product rev. : %s\n",
1272 chtostr(tmp, (u8 *) (work32 + 14), 8)); 1282 chtostr((u8 *) (work32 + 14), 8));
1273 1283
1274 seq_printf(seq, "Serial number : "); 1284 seq_printf(seq, "Serial number : ");
1275 print_serial_number(seq, (u8 *) (work32 + 16), 1285 print_serial_number(seq, (u8 *) (work32 + 16),
@@ -1306,8 +1316,6 @@ static int i2o_seq_show_ddm_identity(struct seq_file *seq, void *v)
1306 u8 pad[256]; // allow up to 256 byte (max) serial number 1316 u8 pad[256]; // allow up to 256 byte (max) serial number
1307 } result; 1317 } result;
1308 1318
1309 char tmp[24 + 1];
1310
1311 token = i2o_parm_field_get(d, 0xF101, -1, &result, sizeof(result)); 1319 token = i2o_parm_field_get(d, 0xF101, -1, &result, sizeof(result));
1312 1320
1313 if (token < 0) { 1321 if (token < 0) {
@@ -1317,9 +1325,9 @@ static int i2o_seq_show_ddm_identity(struct seq_file *seq, void *v)
1317 1325
1318 seq_printf(seq, "Registering DDM TID : 0x%03x\n", result.ddm_tid); 1326 seq_printf(seq, "Registering DDM TID : 0x%03x\n", result.ddm_tid);
1319 seq_printf(seq, "Module name : %s\n", 1327 seq_printf(seq, "Module name : %s\n",
1320 chtostr(tmp, result.module_name, 24)); 1328 chtostr(result.module_name, 24));
1321 seq_printf(seq, "Module revision : %s\n", 1329 seq_printf(seq, "Module revision : %s\n",
1322 chtostr(tmp, result.module_rev, 8)); 1330 chtostr(result.module_rev, 8));
1323 1331
1324 seq_printf(seq, "Serial number : "); 1332 seq_printf(seq, "Serial number : ");
1325 print_serial_number(seq, result.serial_number, sizeof(result) - 36); 1333 print_serial_number(seq, result.serial_number, sizeof(result) - 36);
@@ -1343,8 +1351,6 @@ static int i2o_seq_show_uinfo(struct seq_file *seq, void *v)
1343 u8 instance_number[4]; 1351 u8 instance_number[4];
1344 } result; 1352 } result;
1345 1353
1346 char tmp[64 + 1];
1347
1348 token = i2o_parm_field_get(d, 0xF102, -1, &result, sizeof(result)); 1354 token = i2o_parm_field_get(d, 0xF102, -1, &result, sizeof(result));
1349 1355
1350 if (token < 0) { 1356 if (token < 0) {
@@ -1353,13 +1359,13 @@ static int i2o_seq_show_uinfo(struct seq_file *seq, void *v)
1353 } 1359 }
1354 1360
1355 seq_printf(seq, "Device name : %s\n", 1361 seq_printf(seq, "Device name : %s\n",
1356 chtostr(tmp, result.device_name, 64)); 1362 chtostr(result.device_name, 64));
1357 seq_printf(seq, "Service name : %s\n", 1363 seq_printf(seq, "Service name : %s\n",
1358 chtostr(tmp, result.service_name, 64)); 1364 chtostr(result.service_name, 64));
1359 seq_printf(seq, "Physical name : %s\n", 1365 seq_printf(seq, "Physical name : %s\n",
1360 chtostr(tmp, result.physical_location, 64)); 1366 chtostr(result.physical_location, 64));
1361 seq_printf(seq, "Instance number : %s\n", 1367 seq_printf(seq, "Instance number : %s\n",
1362 chtostr(tmp, result.instance_number, 4)); 1368 chtostr(result.instance_number, 4));
1363 1369
1364 return 0; 1370 return 0;
1365} 1371}
diff --git a/drivers/message/i2o/i2o_scsi.c b/drivers/message/i2o/i2o_scsi.c
index 1d31d7284cb..c8ed7b63fdf 100644
--- a/drivers/message/i2o/i2o_scsi.c
+++ b/drivers/message/i2o/i2o_scsi.c
@@ -57,6 +57,7 @@
57#include <linux/scatterlist.h> 57#include <linux/scatterlist.h>
58 58
59#include <asm/dma.h> 59#include <asm/dma.h>
60#include <asm/system.h>
60#include <asm/io.h> 61#include <asm/io.h>
61#include <linux/atomic.h> 62#include <linux/atomic.h>
62 63
diff --git a/drivers/message/i2o/pci.c b/drivers/message/i2o/pci.c
index 0f9f3e1a2b6..73e4658af53 100644
--- a/drivers/message/i2o/pci.c
+++ b/drivers/message/i2o/pci.c
@@ -31,13 +31,12 @@
31#include <linux/interrupt.h> 31#include <linux/interrupt.h>
32#include <linux/slab.h> 32#include <linux/slab.h>
33#include <linux/i2o.h> 33#include <linux/i2o.h>
34#include <linux/module.h>
35#include "core.h" 34#include "core.h"
36 35
37#define OSM_DESCRIPTION "I2O-subsystem" 36#define OSM_DESCRIPTION "I2O-subsystem"
38 37
39/* PCI device id table for all I2O controllers */ 38/* PCI device id table for all I2O controllers */
40static struct pci_device_id i2o_pci_ids[] = { 39static struct pci_device_id __devinitdata i2o_pci_ids[] = {
41 {PCI_DEVICE_CLASS(PCI_CLASS_INTELLIGENT_I2O << 8, 0xffff00)}, 40 {PCI_DEVICE_CLASS(PCI_CLASS_INTELLIGENT_I2O << 8, 0xffff00)},
42 {PCI_DEVICE(PCI_VENDOR_ID_DPT, 0xa511)}, 41 {PCI_DEVICE(PCI_VENDOR_ID_DPT, 0xa511)},
43 {.vendor = PCI_VENDOR_ID_INTEL,.device = 0x1962, 42 {.vendor = PCI_VENDOR_ID_INTEL,.device = 0x1962,
@@ -84,7 +83,7 @@ static void i2o_pci_free(struct i2o_controller *c)
84 * 83 *
85 * Returns 0 on success or negative error code on failure. 84 * Returns 0 on success or negative error code on failure.
86 */ 85 */
87static int i2o_pci_alloc(struct i2o_controller *c) 86static int __devinit i2o_pci_alloc(struct i2o_controller *c)
88{ 87{
89 struct pci_dev *pdev = c->pdev; 88 struct pci_dev *pdev = c->pdev;
90 struct device *dev = &pdev->dev; 89 struct device *dev = &pdev->dev;
@@ -315,7 +314,8 @@ static void i2o_pci_irq_disable(struct i2o_controller *c)
315 * 314 *
316 * Returns 0 on success or negative error code on failure. 315 * Returns 0 on success or negative error code on failure.
317 */ 316 */
318static int i2o_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) 317static int __devinit i2o_pci_probe(struct pci_dev *pdev,
318 const struct pci_device_id *id)
319{ 319{
320 struct i2o_controller *c; 320 struct i2o_controller *c;
321 int rc; 321 int rc;
@@ -452,7 +452,7 @@ static int i2o_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
452 * Reset the I2O controller, disable interrupts and remove all allocated 452 * Reset the I2O controller, disable interrupts and remove all allocated
453 * resources. 453 * resources.
454 */ 454 */
455static void i2o_pci_remove(struct pci_dev *pdev) 455static void __devexit i2o_pci_remove(struct pci_dev *pdev)
456{ 456{
457 struct i2o_controller *c; 457 struct i2o_controller *c;
458 c = pci_get_drvdata(pdev); 458 c = pci_get_drvdata(pdev);
@@ -473,7 +473,7 @@ static struct pci_driver i2o_pci_driver = {
473 .name = "PCI_I2O", 473 .name = "PCI_I2O",
474 .id_table = i2o_pci_ids, 474 .id_table = i2o_pci_ids,
475 .probe = i2o_pci_probe, 475 .probe = i2o_pci_probe,
476 .remove = i2o_pci_remove, 476 .remove = __devexit_p(i2o_pci_remove),
477}; 477};
478 478
479/** 479/**