16 #include <linux/module.h>
19 #include <linux/string.h>
20 #include <linux/slab.h>
49 return i2o_msg_post_wait(dev->
iop, msg, 60);
68 pr_debug(
"i2o: claim of device %d succeeded\n",
71 pr_debug(
"i2o: claim of device %d failed %d\n",
103 for (tries = 0; tries < 10; tries++) {
113 pr_debug(
"i2o: claim release of device %d succeeded\n",
116 pr_debug(
"i2o: claim release of device %d failed %d\n",
131 static void i2o_device_release(
struct device *dev)
135 pr_debug(
"i2o: device %s released\n", dev_name(dev));
190 static struct i2o_device *i2o_device_alloc(
void)
198 INIT_LIST_HEAD(&dev->
list);
202 dev->
device.release = &i2o_device_release;
222 i2o_dev = i2o_device_alloc();
223 if (IS_ERR(i2o_dev)) {
225 return PTR_ERR(i2o_dev);
244 if (tmp && (tmp != i2o_dev)) {
246 &tmp->
device.kobj,
"user");
254 && (tmp != i2o_dev)) {
256 &i2o_dev->device.kobj,
"user");
263 if (tmp && (tmp != i2o_dev)) {
265 &tmp->
device.kobj,
"parent");
273 && (tmp != i2o_dev)) {
275 &i2o_dev->device.kobj,
"parent");
282 pr_debug(
"i2o: device %s added\n", dev_name(&i2o_dev->device));
362 table_size = buf & 0xffff;
378 pr_debug(
"%s: LCT has %d entries (LCT size: %d)\n", c->
name, max,
381 while (table_size > 0) {
387 entry->
tid = buf >> 16 & 0xfff;
394 entry->
version = buf >> 12 & 0xf;
418 i2o_device_add(c, entry);
428 for (
i = 0;
i <
max;
i++) {
457 int oplen,
void *reslist,
int reslen)
483 i += (oplen / 4 + (oplen % 4 ? 1 : 0));
521 sizeof(opblk), resblk, buflen + 8);
523 memcpy(buf, resblk + 8, buflen);
547 int fieldcount,
void *ibuf,
int ibuflen,
void *resblk,
555 size += 4 - size % 4;
567 opblk[4] = fieldcount;
568 memcpy(opblk + 5, ibuf, ibuflen);
571 size, resblk, reslen);