Lines Matching refs:lpcb

481 static int clp_base_slpc(struct clp_req *req, struct clp_req_rsp_slpc *lpcb)  in clp_base_slpc()  argument
483 unsigned long limit = PAGE_SIZE - sizeof(lpcb->request); in clp_base_slpc()
485 if (lpcb->request.hdr.len != sizeof(lpcb->request) || in clp_base_slpc()
486 lpcb->response.hdr.len > limit) in clp_base_slpc()
488 return clp_req(lpcb, CLP_LPS_BASE) ? -EOPNOTSUPP : 0; in clp_base_slpc()
491 static int clp_base_command(struct clp_req *req, struct clp_req_hdr *lpcb) in clp_base_command() argument
493 switch (lpcb->cmd) { in clp_base_command()
495 return clp_base_slpc(req, (void *) lpcb); in clp_base_command()
501 static int clp_pci_slpc(struct clp_req *req, struct clp_req_rsp_slpc_pci *lpcb) in clp_pci_slpc() argument
503 unsigned long limit = PAGE_SIZE - sizeof(lpcb->request); in clp_pci_slpc()
505 if (lpcb->request.hdr.len != sizeof(lpcb->request) || in clp_pci_slpc()
506 lpcb->response.hdr.len > limit) in clp_pci_slpc()
508 return clp_req(lpcb, CLP_LPS_PCI) ? -EOPNOTSUPP : 0; in clp_pci_slpc()
511 static int clp_pci_list(struct clp_req *req, struct clp_req_rsp_list_pci *lpcb) in clp_pci_list() argument
513 unsigned long limit = PAGE_SIZE - sizeof(lpcb->request); in clp_pci_list()
515 if (lpcb->request.hdr.len != sizeof(lpcb->request) || in clp_pci_list()
516 lpcb->response.hdr.len > limit) in clp_pci_list()
518 if (lpcb->request.reserved2 != 0) in clp_pci_list()
520 return clp_req(lpcb, CLP_LPS_PCI) ? -EOPNOTSUPP : 0; in clp_pci_list()
524 struct clp_req_rsp_query_pci *lpcb) in clp_pci_query() argument
526 unsigned long limit = PAGE_SIZE - sizeof(lpcb->request); in clp_pci_query()
528 if (lpcb->request.hdr.len != sizeof(lpcb->request) || in clp_pci_query()
529 lpcb->response.hdr.len > limit) in clp_pci_query()
531 if (lpcb->request.reserved2 != 0 || lpcb->request.reserved3 != 0) in clp_pci_query()
533 return clp_req(lpcb, CLP_LPS_PCI) ? -EOPNOTSUPP : 0; in clp_pci_query()
537 struct clp_req_rsp_query_pci_grp *lpcb) in clp_pci_query_grp() argument
539 unsigned long limit = PAGE_SIZE - sizeof(lpcb->request); in clp_pci_query_grp()
541 if (lpcb->request.hdr.len != sizeof(lpcb->request) || in clp_pci_query_grp()
542 lpcb->response.hdr.len > limit) in clp_pci_query_grp()
544 if (lpcb->request.reserved2 != 0 || lpcb->request.reserved3 != 0 || in clp_pci_query_grp()
545 lpcb->request.reserved4 != 0) in clp_pci_query_grp()
547 return clp_req(lpcb, CLP_LPS_PCI) ? -EOPNOTSUPP : 0; in clp_pci_query_grp()
550 static int clp_pci_command(struct clp_req *req, struct clp_req_hdr *lpcb) in clp_pci_command() argument
552 switch (lpcb->cmd) { in clp_pci_command()
554 return clp_pci_slpc(req, (void *) lpcb); in clp_pci_command()
556 return clp_pci_list(req, (void *) lpcb); in clp_pci_command()
558 return clp_pci_query(req, (void *) lpcb); in clp_pci_command()
560 return clp_pci_query_grp(req, (void *) lpcb); in clp_pci_command()
568 struct clp_req_hdr *lpcb; in clp_normal_command() local
577 lpcb = clp_alloc_block(GFP_KERNEL); in clp_normal_command()
578 if (!lpcb) in clp_normal_command()
583 if (copy_from_user(lpcb, uptr, PAGE_SIZE) != 0) in clp_normal_command()
587 if (lpcb->fmt != 0 || lpcb->reserved1 != 0 || lpcb->reserved2 != 0) in clp_normal_command()
592 rc = clp_base_command(req, lpcb); in clp_normal_command()
595 rc = clp_pci_command(req, lpcb); in clp_normal_command()
602 if (copy_to_user(uptr, lpcb, PAGE_SIZE) != 0) in clp_normal_command()
608 clp_free_block(lpcb); in clp_normal_command()