Messages in this thread Patch in this message | ![/](/images/icornerl.gif) | | From | "Sergey S. Kostyliov" <> | Subject | [PATCH 2.4] multiple cpqarray controlers with devfs | Date | Thu, 16 Jan 2003 21:56:38 +0300 |
| |
Hello Marcelo,
Without this patch I can't use more than one cpqarray controllers at once on devfs enabled system.
Tested with two controllers: "Smart Array 221" + "SMART-2/P"
All credits goes to Richard Gooch <rgooch@ras.ucalgary.ca>. This patch was already in his devfs patchset, but from what i've seen was never merged in mainline.
Please apply.
===== drivers/block/cpqarray.c 1.27 vs edited ===== --- 1.27/drivers/block/cpqarray.c Tue Dec 17 02:26:25 2002 +++ edited/drivers/block/cpqarray.c Thu Jan 16 20:41:39 2003 @@ -32,6 +32,7 @@ #include <linux/blkpg.h> #include <linux/timer.h> #include <linux/proc_fs.h> +#include <linux/devfs_fs_kernel.h> #include <linux/init.h> #include <linux/hdreg.h> #include <linux/spinlock.h> @@ -69,7 +70,7 @@ static ctlr_info_t *hba[MAX_CTLR] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; - +static devfs_handle_t de_arr[MAX_CTLR][NWD]; static int eisa[8]; #define NR_PRODUCTS (sizeof(products)/sizeof(struct board_type)) @@ -578,9 +579,10 @@ hba[i]->gendisk.max_p = IDA_MAX_PART; hba[i]->gendisk.part = hba[i]->hd; hba[i]->gendisk.sizes = hba[i]->sizes; - hba[i]->gendisk.nr_real = hba[i]->highest_lun+1; + hba[i]->gendisk.nr_real = hba[i]->highest_lun+1; + hba[i]->gendisk.de_arr = de_arr[i]; hba[i]->gendisk.fops = &ida_fops; - + /* Get on the disk list */ add_gendisk(&(hba[i]->gendisk)); @@ -2439,6 +2441,13 @@ } if(log_unit > info_p->highest_lun) info_p->highest_lun = log_unit; + if(!de_arr[ctlr][log_unit]) { + char txt[16]; + sprintf(txt, "ida/c%dd%d", ctlr, + log_unit); + de_arr[ctlr][log_unit] = + devfs_mk_dir(NULL,txt, NULL); + } info_p->phys_drives = sense_config_buf->ctlr_phys_drv; info_p->drv_assign_map @@ -2472,6 +2481,7 @@ cpqarray_remove_one_eisa(i); } } + devfs_unregister(devfs_find_handle(NULL, "ida", 0, 0, 0, 0)); remove_proc_entry("cpqarray", proc_root_driver); } -- Best regards, Sergey S. Kostyliov <rathamahata@php4.ru> Public PGP key: http://sysadminday.org.ru/rathamahata.asc - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| ![\](/images/icornerr.gif) |