Lines Matching refs:lpcb
465 static int clp_base_slpc(struct clp_req *req, struct clp_req_rsp_slpc *lpcb) in clp_base_slpc() argument
467 unsigned long limit = PAGE_SIZE - sizeof(lpcb->request); in clp_base_slpc()
469 if (lpcb->request.hdr.len != sizeof(lpcb->request) || in clp_base_slpc()
470 lpcb->response.hdr.len > limit) in clp_base_slpc()
472 return clp_req(lpcb, CLP_LPS_BASE) ? -EOPNOTSUPP : 0; in clp_base_slpc()
475 static int clp_base_command(struct clp_req *req, struct clp_req_hdr *lpcb) in clp_base_command() argument
477 switch (lpcb->cmd) { in clp_base_command()
479 return clp_base_slpc(req, (void *) lpcb); in clp_base_command()
485 static int clp_pci_slpc(struct clp_req *req, struct clp_req_rsp_slpc_pci *lpcb) in clp_pci_slpc() argument
487 unsigned long limit = PAGE_SIZE - sizeof(lpcb->request); in clp_pci_slpc()
489 if (lpcb->request.hdr.len != sizeof(lpcb->request) || in clp_pci_slpc()
490 lpcb->response.hdr.len > limit) in clp_pci_slpc()
492 return clp_req(lpcb, CLP_LPS_PCI) ? -EOPNOTSUPP : 0; in clp_pci_slpc()
495 static int clp_pci_list(struct clp_req *req, struct clp_req_rsp_list_pci *lpcb) in clp_pci_list() argument
497 unsigned long limit = PAGE_SIZE - sizeof(lpcb->request); in clp_pci_list()
499 if (lpcb->request.hdr.len != sizeof(lpcb->request) || in clp_pci_list()
500 lpcb->response.hdr.len > limit) in clp_pci_list()
502 if (lpcb->request.reserved2 != 0) in clp_pci_list()
504 return clp_req(lpcb, CLP_LPS_PCI) ? -EOPNOTSUPP : 0; in clp_pci_list()
508 struct clp_req_rsp_query_pci *lpcb) in clp_pci_query() argument
510 unsigned long limit = PAGE_SIZE - sizeof(lpcb->request); in clp_pci_query()
512 if (lpcb->request.hdr.len != sizeof(lpcb->request) || in clp_pci_query()
513 lpcb->response.hdr.len > limit) in clp_pci_query()
515 if (lpcb->request.reserved2 != 0 || lpcb->request.reserved3 != 0) in clp_pci_query()
517 return clp_req(lpcb, CLP_LPS_PCI) ? -EOPNOTSUPP : 0; in clp_pci_query()
521 struct clp_req_rsp_query_pci_grp *lpcb) in clp_pci_query_grp() argument
523 unsigned long limit = PAGE_SIZE - sizeof(lpcb->request); in clp_pci_query_grp()
525 if (lpcb->request.hdr.len != sizeof(lpcb->request) || in clp_pci_query_grp()
526 lpcb->response.hdr.len > limit) in clp_pci_query_grp()
528 if (lpcb->request.reserved2 != 0 || lpcb->request.reserved3 != 0 || in clp_pci_query_grp()
529 lpcb->request.reserved4 != 0) in clp_pci_query_grp()
531 return clp_req(lpcb, CLP_LPS_PCI) ? -EOPNOTSUPP : 0; in clp_pci_query_grp()
534 static int clp_pci_command(struct clp_req *req, struct clp_req_hdr *lpcb) in clp_pci_command() argument
536 switch (lpcb->cmd) { in clp_pci_command()
538 return clp_pci_slpc(req, (void *) lpcb); in clp_pci_command()
540 return clp_pci_list(req, (void *) lpcb); in clp_pci_command()
542 return clp_pci_query(req, (void *) lpcb); in clp_pci_command()
544 return clp_pci_query_grp(req, (void *) lpcb); in clp_pci_command()
552 struct clp_req_hdr *lpcb; in clp_normal_command() local
561 lpcb = clp_alloc_block(GFP_KERNEL); in clp_normal_command()
562 if (!lpcb) in clp_normal_command()
567 if (copy_from_user(lpcb, uptr, PAGE_SIZE) != 0) in clp_normal_command()
571 if (lpcb->fmt != 0 || lpcb->reserved1 != 0 || lpcb->reserved2 != 0) in clp_normal_command()
576 rc = clp_base_command(req, lpcb); in clp_normal_command()
579 rc = clp_pci_command(req, lpcb); in clp_normal_command()
586 if (copy_to_user(uptr, lpcb, PAGE_SIZE) != 0) in clp_normal_command()
592 clp_free_block(lpcb); in clp_normal_command()