Lines Matching refs:lpcb

495 static int clp_base_slpc(struct clp_req *req, struct clp_req_rsp_slpc *lpcb)  in clp_base_slpc()  argument
497 unsigned long limit = PAGE_SIZE - sizeof(lpcb->request); in clp_base_slpc()
499 if (lpcb->request.hdr.len != sizeof(lpcb->request) || in clp_base_slpc()
500 lpcb->response.hdr.len > limit) in clp_base_slpc()
502 return clp_req(lpcb, CLP_LPS_BASE) ? -EOPNOTSUPP : 0; in clp_base_slpc()
505 static int clp_base_command(struct clp_req *req, struct clp_req_hdr *lpcb) in clp_base_command() argument
507 switch (lpcb->cmd) { in clp_base_command()
509 return clp_base_slpc(req, (void *) lpcb); in clp_base_command()
515 static int clp_pci_slpc(struct clp_req *req, struct clp_req_rsp_slpc_pci *lpcb) in clp_pci_slpc() argument
517 unsigned long limit = PAGE_SIZE - sizeof(lpcb->request); in clp_pci_slpc()
519 if (lpcb->request.hdr.len != sizeof(lpcb->request) || in clp_pci_slpc()
520 lpcb->response.hdr.len > limit) in clp_pci_slpc()
522 return clp_req(lpcb, CLP_LPS_PCI) ? -EOPNOTSUPP : 0; in clp_pci_slpc()
525 static int clp_pci_list(struct clp_req *req, struct clp_req_rsp_list_pci *lpcb) in clp_pci_list() argument
527 unsigned long limit = PAGE_SIZE - sizeof(lpcb->request); in clp_pci_list()
529 if (lpcb->request.hdr.len != sizeof(lpcb->request) || in clp_pci_list()
530 lpcb->response.hdr.len > limit) in clp_pci_list()
532 if (lpcb->request.reserved2 != 0) in clp_pci_list()
534 return clp_req(lpcb, CLP_LPS_PCI) ? -EOPNOTSUPP : 0; in clp_pci_list()
538 struct clp_req_rsp_query_pci *lpcb) in clp_pci_query() argument
540 unsigned long limit = PAGE_SIZE - sizeof(lpcb->request); in clp_pci_query()
542 if (lpcb->request.hdr.len != sizeof(lpcb->request) || in clp_pci_query()
543 lpcb->response.hdr.len > limit) in clp_pci_query()
545 if (lpcb->request.reserved2 != 0 || lpcb->request.reserved3 != 0) in clp_pci_query()
547 return clp_req(lpcb, CLP_LPS_PCI) ? -EOPNOTSUPP : 0; in clp_pci_query()
551 struct clp_req_rsp_query_pci_grp *lpcb) in clp_pci_query_grp() argument
553 unsigned long limit = PAGE_SIZE - sizeof(lpcb->request); in clp_pci_query_grp()
555 if (lpcb->request.hdr.len != sizeof(lpcb->request) || in clp_pci_query_grp()
556 lpcb->response.hdr.len > limit) in clp_pci_query_grp()
558 if (lpcb->request.reserved2 != 0 || lpcb->request.reserved3 != 0 || in clp_pci_query_grp()
559 lpcb->request.reserved4 != 0) in clp_pci_query_grp()
561 return clp_req(lpcb, CLP_LPS_PCI) ? -EOPNOTSUPP : 0; in clp_pci_query_grp()
564 static int clp_pci_command(struct clp_req *req, struct clp_req_hdr *lpcb) in clp_pci_command() argument
566 switch (lpcb->cmd) { in clp_pci_command()
568 return clp_pci_slpc(req, (void *) lpcb); in clp_pci_command()
570 return clp_pci_list(req, (void *) lpcb); in clp_pci_command()
572 return clp_pci_query(req, (void *) lpcb); in clp_pci_command()
574 return clp_pci_query_grp(req, (void *) lpcb); in clp_pci_command()
582 struct clp_req_hdr *lpcb; in clp_normal_command() local
591 lpcb = clp_alloc_block(GFP_KERNEL); in clp_normal_command()
592 if (!lpcb) in clp_normal_command()
597 if (copy_from_user(lpcb, uptr, PAGE_SIZE) != 0) in clp_normal_command()
601 if (lpcb->fmt != 0 || lpcb->reserved1 != 0 || lpcb->reserved2 != 0) in clp_normal_command()
606 rc = clp_base_command(req, lpcb); in clp_normal_command()
609 rc = clp_pci_command(req, lpcb); in clp_normal_command()
616 if (copy_to_user(uptr, lpcb, PAGE_SIZE) != 0) in clp_normal_command()
622 clp_free_block(lpcb); in clp_normal_command()