Commit 7da60b9c authored by Alan Cox's avatar Alan Cox Committed by Linus Torvalds

[PATCH] Remove i2o pci abstractions

parent fe015954
...@@ -754,7 +754,7 @@ static int i2ob_evt(void *dummy) ...@@ -754,7 +754,7 @@ static int i2ob_evt(void *dummy)
* hit the fan big time. The card seems to recover but loses * hit the fan big time. The card seems to recover but loses
* the pending writes. Deeply ungood except for testing fsck * the pending writes. Deeply ungood except for testing fsck
*/ */
if(i2ob_dev[unit].i2odev->controller->bus.pci.promise) if(i2ob_dev[unit].i2odev->controller->promise)
panic("I2O controller firmware failed. Reboot and force a filesystem check.\n"); panic("I2O controller firmware failed. Reboot and force a filesystem check.\n");
default: default:
printk(KERN_INFO "%s: Received event 0x%X we didn't register for\n" printk(KERN_INFO "%s: Received event 0x%X we didn't register for\n"
...@@ -1140,10 +1140,10 @@ static int i2ob_install_device(struct i2o_controller *c, struct i2o_device *d, i ...@@ -1140,10 +1140,10 @@ static int i2ob_install_device(struct i2o_controller *c, struct i2o_device *d, i
if(d->controller->battery == 0) if(d->controller->battery == 0)
i2ob_dev[i].wcache = CACHE_WRITETHROUGH; i2ob_dev[i].wcache = CACHE_WRITETHROUGH;
if(d->controller->type == I2O_TYPE_PCI && d->controller->bus.pci.promise) if(d->controller->promise)
i2ob_dev[i].wcache = CACHE_WRITETHROUGH; i2ob_dev[i].wcache = CACHE_WRITETHROUGH;
if(d->controller->type == I2O_TYPE_PCI && d->controller->bus.pci.short_req) if(d->controller->short_req)
{ {
blk_queue_max_sectors(q, 8); blk_queue_max_sectors(q, 8);
blk_queue_max_phys_segments(q, 8); blk_queue_max_phys_segments(q, 8);
......
This diff is collapsed.
...@@ -32,9 +32,6 @@ ...@@ -32,9 +32,6 @@
#include <asm/io.h> #include <asm/io.h>
#ifdef CONFIG_MTRR
#include <asm/mtrr.h>
#endif // CONFIG_MTRR
static int dpt; static int dpt;
......
...@@ -836,10 +836,14 @@ int i2o_proc_read_ddm_table(char *buf, char **start, off_t offset, int len, ...@@ -836,10 +836,14 @@ int i2o_proc_read_ddm_table(char *buf, char **start, off_t offset, int len,
u16 row_count; u16 row_count;
u16 more_flag; u16 more_flag;
i2o_exec_execute_ddm_table ddm_table[MAX_I2O_MODULES]; i2o_exec_execute_ddm_table ddm_table[MAX_I2O_MODULES];
} result; } *result;
i2o_exec_execute_ddm_table ddm_table; i2o_exec_execute_ddm_table ddm_table;
result = kmalloc(sizeof(*result), GFP_KERNEL);
if(!result)
return -ENOMEM;
spin_lock(&i2o_proc_lock); spin_lock(&i2o_proc_lock);
len = 0; len = 0;
...@@ -847,18 +851,17 @@ int i2o_proc_read_ddm_table(char *buf, char **start, off_t offset, int len, ...@@ -847,18 +851,17 @@ int i2o_proc_read_ddm_table(char *buf, char **start, off_t offset, int len,
c, ADAPTER_TID, c, ADAPTER_TID,
0x0003, -1, 0x0003, -1,
NULL, 0, NULL, 0,
&result, sizeof(result)); result, sizeof(*result));
if (token < 0) { if (token < 0) {
len += i2o_report_query_status(buf+len, token,"0x0003 Executing DDM List"); len += i2o_report_query_status(buf+len, token,"0x0003 Executing DDM List");
spin_unlock(&i2o_proc_lock); goto out;
return len;
} }
len += sprintf(buf+len, "Tid Module_type Vendor Mod_id Module_name Vrs Data_size Code_size\n"); len += sprintf(buf+len, "Tid Module_type Vendor Mod_id Module_name Vrs Data_size Code_size\n");
ddm_table=result.ddm_table[0]; ddm_table=result->ddm_table[0];
for(i=0; i < result.row_count; ddm_table=result.ddm_table[++i]) for(i=0; i < result->row_count; ddm_table=result->ddm_table[++i])
{ {
len += sprintf(buf+len, "0x%03x ", ddm_table.ddm_tid & 0xFFF); len += sprintf(buf+len, "0x%03x ", ddm_table.ddm_tid & 0xFFF);
...@@ -882,9 +885,9 @@ int i2o_proc_read_ddm_table(char *buf, char **start, off_t offset, int len, ...@@ -882,9 +885,9 @@ int i2o_proc_read_ddm_table(char *buf, char **start, off_t offset, int len,
len += sprintf(buf+len, "\n"); len += sprintf(buf+len, "\n");
} }
out:
spin_unlock(&i2o_proc_lock); spin_unlock(&i2o_proc_lock);
kfree(result);
return len; return len;
} }
...@@ -1047,7 +1050,11 @@ int i2o_proc_read_groups(char *buf, char **start, off_t offset, int len, ...@@ -1047,7 +1050,11 @@ int i2o_proc_read_groups(char *buf, char **start, off_t offset, int len,
u16 row_count; u16 row_count;
u16 more_flag; u16 more_flag;
i2o_group_info group[256]; i2o_group_info group[256];
} result; } *result;
result = kmalloc(sizeof(*result), GFP_KERNEL);
if(!result)
return -ENOMEM;
spin_lock(&i2o_proc_lock); spin_lock(&i2o_proc_lock);
...@@ -1055,24 +1062,23 @@ int i2o_proc_read_groups(char *buf, char **start, off_t offset, int len, ...@@ -1055,24 +1062,23 @@ int i2o_proc_read_groups(char *buf, char **start, off_t offset, int len,
token = i2o_query_table(I2O_PARAMS_TABLE_GET, token = i2o_query_table(I2O_PARAMS_TABLE_GET,
d->controller, d->lct_data.tid, 0xF000, -1, NULL, 0, d->controller, d->lct_data.tid, 0xF000, -1, NULL, 0,
&result, sizeof(result)); result, sizeof(*result));
if (token < 0) { if (token < 0) {
len = i2o_report_query_status(buf+len, token, "0xF000 Params Descriptor"); len = i2o_report_query_status(buf+len, token, "0xF000 Params Descriptor");
spin_unlock(&i2o_proc_lock); goto out;
return len;
} }
len += sprintf(buf+len, "# Group FieldCount RowCount Type Add Del Clear\n"); len += sprintf(buf+len, "# Group FieldCount RowCount Type Add Del Clear\n");
for (i=0; i < result.row_count; i++) for (i=0; i < result->row_count; i++)
{ {
len += sprintf(buf+len, "%-3d", i); len += sprintf(buf+len, "%-3d", i);
len += sprintf(buf+len, "0x%04X ", result.group[i].group_number); len += sprintf(buf+len, "0x%04X ", result->group[i].group_number);
len += sprintf(buf+len, "%10d ", result.group[i].field_count); len += sprintf(buf+len, "%10d ", result->group[i].field_count);
len += sprintf(buf+len, "%8d ", result.group[i].row_count); len += sprintf(buf+len, "%8d ", result->group[i].row_count);
properties = result.group[i].properties; properties = result->group[i].properties;
if (properties & 0x1) len += sprintf(buf+len, "Table "); if (properties & 0x1) len += sprintf(buf+len, "Table ");
else len += sprintf(buf+len, "Scalar "); else len += sprintf(buf+len, "Scalar ");
if (properties & 0x2) len += sprintf(buf+len, " + "); if (properties & 0x2) len += sprintf(buf+len, " + ");
...@@ -1085,11 +1091,11 @@ int i2o_proc_read_groups(char *buf, char **start, off_t offset, int len, ...@@ -1085,11 +1091,11 @@ int i2o_proc_read_groups(char *buf, char **start, off_t offset, int len,
len += sprintf(buf+len, "\n"); len += sprintf(buf+len, "\n");
} }
if (result.more_flag) if (result->more_flag)
len += sprintf(buf+len, "There is more...\n"); len += sprintf(buf+len, "There is more...\n");
out:
spin_unlock(&i2o_proc_lock); spin_unlock(&i2o_proc_lock);
kfree(result);
return len; return len;
} }
...@@ -1220,7 +1226,11 @@ int i2o_proc_read_users(char *buf, char **start, off_t offset, int len, ...@@ -1220,7 +1226,11 @@ int i2o_proc_read_users(char *buf, char **start, off_t offset, int len,
u16 row_count; u16 row_count;
u16 more_flag; u16 more_flag;
i2o_user_table user[64]; i2o_user_table user[64];
} result; } *result;
result = kmalloc(sizeof(*result), GFP_KERNEL);
if(!result)
return -ENOMEM;
spin_lock(&i2o_proc_lock); spin_lock(&i2o_proc_lock);
len = 0; len = 0;
...@@ -1228,28 +1238,28 @@ int i2o_proc_read_users(char *buf, char **start, off_t offset, int len, ...@@ -1228,28 +1238,28 @@ int i2o_proc_read_users(char *buf, char **start, off_t offset, int len,
token = i2o_query_table(I2O_PARAMS_TABLE_GET, token = i2o_query_table(I2O_PARAMS_TABLE_GET,
d->controller, d->lct_data.tid, d->controller, d->lct_data.tid,
0xF003, -1, NULL, 0, 0xF003, -1, NULL, 0,
&result, sizeof(result)); result, sizeof(*result));
if (token < 0) { if (token < 0) {
len += i2o_report_query_status(buf+len, token,"0xF003 User Table"); len += i2o_report_query_status(buf+len, token,"0xF003 User Table");
spin_unlock(&i2o_proc_lock); goto out;
return len;
} }
len += sprintf(buf+len, "# Instance UserTid ClaimType\n"); len += sprintf(buf+len, "# Instance UserTid ClaimType\n");
for(i=0; i < result.row_count; i++) for(i=0; i < result->row_count; i++)
{ {
len += sprintf(buf+len, "%-3d", i); len += sprintf(buf+len, "%-3d", i);
len += sprintf(buf+len, "%#8x ", result.user[i].instance); len += sprintf(buf+len, "%#8x ", result->user[i].instance);
len += sprintf(buf+len, "%#7x ", result.user[i].user_tid); len += sprintf(buf+len, "%#7x ", result->user[i].user_tid);
len += sprintf(buf+len, "%#9x\n", result.user[i].claim_type); len += sprintf(buf+len, "%#9x\n", result->user[i].claim_type);
} }
if (result.more_flag) if (result->more_flag)
len += sprintf(buf+len, "There is more...\n"); len += sprintf(buf+len, "There is more...\n");
out:
spin_unlock(&i2o_proc_lock); spin_unlock(&i2o_proc_lock);
kfree(result);
return len; return len;
} }
...@@ -2264,24 +2274,27 @@ int i2o_proc_read_lan_mcast_addr(char *buf, char **start, off_t offset, ...@@ -2264,24 +2274,27 @@ int i2o_proc_read_lan_mcast_addr(char *buf, char **start, off_t offset,
u16 row_count; u16 row_count;
u16 more_flag; u16 more_flag;
u8 mc_addr[256][8]; u8 mc_addr[256][8];
} result; } *result;
result = kmalloc(sizeof(*result), GFP_KERNEL);
if(!result)
return -ENOMEM;
spin_lock(&i2o_proc_lock); spin_lock(&i2o_proc_lock);
len = 0; len = 0;
token = i2o_query_table(I2O_PARAMS_TABLE_GET, token = i2o_query_table(I2O_PARAMS_TABLE_GET,
d->controller, d->lct_data.tid, 0x0002, -1, d->controller, d->lct_data.tid, 0x0002, -1,
NULL, 0, &result, sizeof(result)); NULL, 0, result, sizeof(*result));
if (token < 0) { if (token < 0) {
len += i2o_report_query_status(buf+len, token,"0x002 LAN Multicast MAC Address"); len += i2o_report_query_status(buf+len, token,"0x002 LAN Multicast MAC Address");
spin_unlock(&i2o_proc_lock); goto out;
return len;
} }
for (i = 0; i < result.row_count; i++) for (i = 0; i < result->row_count; i++)
{ {
memcpy(mc_addr, result.mc_addr[i], 8); memcpy(mc_addr, result->mc_addr[i], 8);
len += sprintf(buf+len, "MC MAC address[%d]: " len += sprintf(buf+len, "MC MAC address[%d]: "
"%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X\n", "%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X\n",
...@@ -2289,8 +2302,9 @@ int i2o_proc_read_lan_mcast_addr(char *buf, char **start, off_t offset, ...@@ -2289,8 +2302,9 @@ int i2o_proc_read_lan_mcast_addr(char *buf, char **start, off_t offset,
mc_addr[3], mc_addr[4], mc_addr[5], mc_addr[3], mc_addr[4], mc_addr[5],
mc_addr[6], mc_addr[7]); mc_addr[6], mc_addr[7]);
} }
out:
spin_unlock(&i2o_proc_lock); spin_unlock(&i2o_proc_lock);
kfree(result);
return len; return len;
} }
...@@ -2495,32 +2509,36 @@ int i2o_proc_read_lan_alt_addr(char *buf, char **start, off_t offset, int len, ...@@ -2495,32 +2509,36 @@ int i2o_proc_read_lan_alt_addr(char *buf, char **start, off_t offset, int len,
u16 row_count; u16 row_count;
u16 more_flag; u16 more_flag;
u8 alt_addr[256][8]; u8 alt_addr[256][8];
} result; } *result;
result = kmalloc(sizeof(*result), GFP_KERNEL);
if(!result)
return -ENOMEM;
spin_lock(&i2o_proc_lock); spin_lock(&i2o_proc_lock);
len = 0; len = 0;
token = i2o_query_table(I2O_PARAMS_TABLE_GET, token = i2o_query_table(I2O_PARAMS_TABLE_GET,
d->controller, d->lct_data.tid, d->controller, d->lct_data.tid,
0x0006, -1, NULL, 0, &result, sizeof(result)); 0x0006, -1, NULL, 0, result, sizeof(*result));
if (token < 0) { if (token < 0) {
len += i2o_report_query_status(buf+len, token, "0x0006 LAN Alternate Address (optional)"); len += i2o_report_query_status(buf+len, token, "0x0006 LAN Alternate Address (optional)");
spin_unlock(&i2o_proc_lock); goto out;
return len;
} }
for (i=0; i < result.row_count; i++) for (i=0; i < result->row_count; i++)
{ {
memcpy(alt_addr,result.alt_addr[i],8); memcpy(alt_addr,result->alt_addr[i],8);
len += sprintf(buf+len, "Alternate address[%d]: " len += sprintf(buf+len, "Alternate address[%d]: "
"%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X\n", "%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X\n",
i, alt_addr[0], alt_addr[1], alt_addr[2], i, alt_addr[0], alt_addr[1], alt_addr[2],
alt_addr[3], alt_addr[4], alt_addr[5], alt_addr[3], alt_addr[4], alt_addr[5],
alt_addr[6], alt_addr[7]); alt_addr[6], alt_addr[7]);
} }
out:
spin_unlock(&i2o_proc_lock); spin_unlock(&i2o_proc_lock);
kfree(result);
return len; return len;
} }
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
#include <linux/i2o-dev.h> #include <linux/i2o-dev.h>
/* How many different OSM's are we allowing */ /* How many different OSM's are we allowing */
#define MAX_I2O_MODULES 64 #define MAX_I2O_MODULES 4
/* How many OSMs can register themselves for device status updates? */ /* How many OSMs can register themselves for device status updates? */
#define I2O_MAX_MANAGERS 4 #define I2O_MAX_MANAGERS 4
...@@ -76,10 +76,16 @@ struct i2o_device ...@@ -76,10 +76,16 @@ struct i2o_device
}; };
/* /*
* Resource data for each PCI I2O controller * Each I2O controller has one of these objects
*/ */
struct i2o_pci struct i2o_controller
{ {
char name[16];
int unit;
int type;
int enabled;
struct pci_dev *pdev; /* PCI device */
int irq; int irq;
int short_req:1; /* Use small block sizes */ int short_req:1; /* Use small block sizes */
int dpt:1; /* Don't quiesce */ int dpt:1; /* Don't quiesce */
...@@ -88,25 +94,6 @@ struct i2o_pci ...@@ -88,25 +94,6 @@ struct i2o_pci
int mtrr_reg0; int mtrr_reg0;
int mtrr_reg1; int mtrr_reg1;
#endif #endif
};
/*
* Transport types supported by I2O stack
*/
#define I2O_TYPE_PCI 0x01 /* PCI I2O controller */
/*
* Each I2O controller has one of these objects
*/
struct i2o_controller
{
struct pci_dev *pdev; /* PCI device */
char name[16];
int unit;
int type;
int enabled;
struct notifier_block *event_notifer; /* Events */ struct notifier_block *event_notifer; /* Events */
atomic_t users; atomic_t users;
...@@ -143,22 +130,6 @@ struct i2o_controller ...@@ -143,22 +130,6 @@ struct i2o_controller
struct proc_dir_entry *proc_entry; /* /proc dir */ struct proc_dir_entry *proc_entry; /* /proc dir */
union { /* Bus information */
struct i2o_pci pci;
} bus;
/* Bus specific destructor */
void (*destructor)(struct i2o_controller *);
/* Bus specific attach/detach */
int (*bind)(struct i2o_controller *, struct i2o_device *);
/* Bus specific initiator */
int (*unbind)(struct i2o_controller *, struct i2o_device *);
/* Bus specific enable/disable */
void (*bus_enable)(struct i2o_controller *);
void (*bus_disable)(struct i2o_controller *);
void *page_frame; /* Message buffers */ void *page_frame; /* Message buffers */
dma_addr_t page_frame_map; /* Cache map */ dma_addr_t page_frame_map; /* Cache map */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment