Lines Matching refs:lpcb
491 static int clp_base_slpc(struct clp_req *req, struct clp_req_rsp_slpc *lpcb) in clp_base_slpc() argument
493 unsigned long limit = PAGE_SIZE - sizeof(lpcb->request); in clp_base_slpc()
495 if (lpcb->request.hdr.len != sizeof(lpcb->request) || in clp_base_slpc()
496 lpcb->response.hdr.len > limit) in clp_base_slpc()
498 return clp_req(lpcb, CLP_LPS_BASE) ? -EOPNOTSUPP : 0; in clp_base_slpc()
501 static int clp_base_command(struct clp_req *req, struct clp_req_hdr *lpcb) in clp_base_command() argument
503 switch (lpcb->cmd) { in clp_base_command()
505 return clp_base_slpc(req, (void *) lpcb); in clp_base_command()
511 static int clp_pci_slpc(struct clp_req *req, struct clp_req_rsp_slpc_pci *lpcb) in clp_pci_slpc() argument
513 unsigned long limit = PAGE_SIZE - sizeof(lpcb->request); in clp_pci_slpc()
515 if (lpcb->request.hdr.len != sizeof(lpcb->request) || in clp_pci_slpc()
516 lpcb->response.hdr.len > limit) in clp_pci_slpc()
518 return clp_req(lpcb, CLP_LPS_PCI) ? -EOPNOTSUPP : 0; in clp_pci_slpc()
521 static int clp_pci_list(struct clp_req *req, struct clp_req_rsp_list_pci *lpcb) in clp_pci_list() argument
523 unsigned long limit = PAGE_SIZE - sizeof(lpcb->request); in clp_pci_list()
525 if (lpcb->request.hdr.len != sizeof(lpcb->request) || in clp_pci_list()
526 lpcb->response.hdr.len > limit) in clp_pci_list()
528 if (lpcb->request.reserved2 != 0) in clp_pci_list()
530 return clp_req(lpcb, CLP_LPS_PCI) ? -EOPNOTSUPP : 0; in clp_pci_list()
534 struct clp_req_rsp_query_pci *lpcb) in clp_pci_query() argument
536 unsigned long limit = PAGE_SIZE - sizeof(lpcb->request); in clp_pci_query()
538 if (lpcb->request.hdr.len != sizeof(lpcb->request) || in clp_pci_query()
539 lpcb->response.hdr.len > limit) in clp_pci_query()
541 if (lpcb->request.reserved2 != 0 || lpcb->request.reserved3 != 0) in clp_pci_query()
543 return clp_req(lpcb, CLP_LPS_PCI) ? -EOPNOTSUPP : 0; in clp_pci_query()
547 struct clp_req_rsp_query_pci_grp *lpcb) in clp_pci_query_grp() argument
549 unsigned long limit = PAGE_SIZE - sizeof(lpcb->request); in clp_pci_query_grp()
551 if (lpcb->request.hdr.len != sizeof(lpcb->request) || in clp_pci_query_grp()
552 lpcb->response.hdr.len > limit) in clp_pci_query_grp()
554 if (lpcb->request.reserved2 != 0 || lpcb->request.reserved3 != 0 || in clp_pci_query_grp()
555 lpcb->request.reserved4 != 0) in clp_pci_query_grp()
557 return clp_req(lpcb, CLP_LPS_PCI) ? -EOPNOTSUPP : 0; in clp_pci_query_grp()
560 static int clp_pci_command(struct clp_req *req, struct clp_req_hdr *lpcb) in clp_pci_command() argument
562 switch (lpcb->cmd) { in clp_pci_command()
564 return clp_pci_slpc(req, (void *) lpcb); in clp_pci_command()
566 return clp_pci_list(req, (void *) lpcb); in clp_pci_command()
568 return clp_pci_query(req, (void *) lpcb); in clp_pci_command()
570 return clp_pci_query_grp(req, (void *) lpcb); in clp_pci_command()
578 struct clp_req_hdr *lpcb; in clp_normal_command() local
587 lpcb = clp_alloc_block(GFP_KERNEL); in clp_normal_command()
588 if (!lpcb) in clp_normal_command()
593 if (copy_from_user(lpcb, uptr, PAGE_SIZE) != 0) in clp_normal_command()
597 if (lpcb->fmt != 0 || lpcb->reserved1 != 0 || lpcb->reserved2 != 0) in clp_normal_command()
602 rc = clp_base_command(req, lpcb); in clp_normal_command()
605 rc = clp_pci_command(req, lpcb); in clp_normal_command()
612 if (copy_to_user(uptr, lpcb, PAGE_SIZE) != 0) in clp_normal_command()
618 clp_free_block(lpcb); in clp_normal_command()