Lines Matching defs:op
144 static int opromgetprop(void __user *argp, struct device_node *dp, struct openpromio *op, int bufsize)
150 !(pval = of_get_property(dp, op->oprom_array, &len)) ||
152 return copyout(argp, op, sizeof(int));
154 memcpy(op->oprom_array, pval, len);
155 op->oprom_array[len] = '\0';
156 op->oprom_size = len;
158 return copyout(argp, op, sizeof(int) + bufsize);
161 static int opromnxtprop(void __user *argp, struct device_node *dp, struct openpromio *op, int bufsize)
167 return copyout(argp, op, sizeof(int));
168 if (op->oprom_array[0] == '\0') {
171 return copyout(argp, op, sizeof(int));
174 prop = of_find_property(dp, op->oprom_array, NULL);
179 return copyout(argp, op, sizeof(int));
184 memcpy(op->oprom_array, prop->name, len);
185 op->oprom_array[len] = '\0';
186 op->oprom_size = ++len;
188 return copyout(argp, op, sizeof(int) + bufsize);
191 static int opromsetopt(struct device_node *dp, struct openpromio *op, int bufsize)
193 char *buf = op->oprom_array + strlen(op->oprom_array) + 1;
194 int len = op->oprom_array + bufsize - buf;
196 return of_set_property(options_node, op->oprom_array, buf, len);
199 static int opromnext(void __user *argp, unsigned int cmd, struct device_node *dp, struct openpromio *op, int bufsize, DATA *data)
208 ph = *((int *) op->oprom_array);
240 *((int *) op->oprom_array) = ph;
241 op->oprom_size = sizeof(phandle);
243 return copyout(argp, op, bufsize + sizeof(int));
246 static int oprompci2node(void __user *argp, struct device_node *dp, struct openpromio *op, int bufsize, DATA *data)
255 pdev = pci_get_bus_and_slot (((int *) op->oprom_array)[0],
256 ((int *) op->oprom_array)[1]);
260 *((int *)op->oprom_array) = dp->phandle;
261 op->oprom_size = sizeof(int);
262 err = copyout(argp, op, bufsize + sizeof(int));
271 static int oprompath2node(void __user *argp, struct device_node *dp, struct openpromio *op, int bufsize, DATA *data)
275 dp = of_find_node_by_path(op->oprom_array);
279 *((int *)op->oprom_array) = ph;
280 op->oprom_size = sizeof(int);
282 return copyout(argp, op, bufsize + sizeof(int));
285 static int opromgetbootargs(void __user *argp, struct openpromio *op, int bufsize)
293 strcpy(op->oprom_array, buf);
294 op->oprom_size = len;
296 return copyout(argp, op, bufsize + sizeof(int));
415 struct opiocdesc op;
421 if (copy_from_user(&op, argp, sizeof(op)))
424 dp = get_node(op.op_nodeid, data);
426 err = copyin_string(op.op_name, op.op_namelen, &str);
432 if (!pval || len > op.op_buflen) {
435 op.op_buflen = len;
436 if (copy_to_user(argp, &op, sizeof(op)) ||
437 copy_to_user(op.op_buf, pval, len))
447 struct opiocdesc op;
453 if (copy_from_user(&op, argp, sizeof(op)))
456 dp = get_node(op.op_nodeid, data);
460 err = copyin_string(op.op_name, op.op_namelen, &str);
478 if (len > op.op_buflen)
479 len = op.op_buflen;
481 if (copy_to_user(argp, &op, sizeof(op)))
485 copy_to_user(op.op_buf, prop->value, len))
493 struct opiocdesc op;
498 if (copy_from_user(&op, argp, sizeof(op)))
501 dp = get_node(op.op_nodeid, data);
505 err = copyin_string(op.op_name, op.op_namelen, &str);
509 err = copyin_string(op.op_buf, op.op_buflen, &tmp);
515 err = of_set_property(dp, str, tmp, op.op_buflen);