Lines Matching refs:lpcb

474 static int clp_base_slpc(struct clp_req *req, struct clp_req_rsp_slpc *lpcb)  in clp_base_slpc()  argument
476 unsigned long limit = PAGE_SIZE - sizeof(lpcb->request); in clp_base_slpc()
478 if (lpcb->request.hdr.len != sizeof(lpcb->request) || in clp_base_slpc()
479 lpcb->response.hdr.len > limit) in clp_base_slpc()
481 return clp_req(lpcb, CLP_LPS_BASE) ? -EOPNOTSUPP : 0; in clp_base_slpc()
484 static int clp_base_command(struct clp_req *req, struct clp_req_hdr *lpcb) in clp_base_command() argument
486 switch (lpcb->cmd) { in clp_base_command()
488 return clp_base_slpc(req, (void *) lpcb); in clp_base_command()
494 static int clp_pci_slpc(struct clp_req *req, struct clp_req_rsp_slpc_pci *lpcb) in clp_pci_slpc() argument
496 unsigned long limit = PAGE_SIZE - sizeof(lpcb->request); in clp_pci_slpc()
498 if (lpcb->request.hdr.len != sizeof(lpcb->request) || in clp_pci_slpc()
499 lpcb->response.hdr.len > limit) in clp_pci_slpc()
501 return clp_req(lpcb, CLP_LPS_PCI) ? -EOPNOTSUPP : 0; in clp_pci_slpc()
504 static int clp_pci_list(struct clp_req *req, struct clp_req_rsp_list_pci *lpcb) in clp_pci_list() argument
506 unsigned long limit = PAGE_SIZE - sizeof(lpcb->request); in clp_pci_list()
508 if (lpcb->request.hdr.len != sizeof(lpcb->request) || in clp_pci_list()
509 lpcb->response.hdr.len > limit) in clp_pci_list()
511 if (lpcb->request.reserved2 != 0) in clp_pci_list()
513 return clp_req(lpcb, CLP_LPS_PCI) ? -EOPNOTSUPP : 0; in clp_pci_list()
517 struct clp_req_rsp_query_pci *lpcb) in clp_pci_query() argument
519 unsigned long limit = PAGE_SIZE - sizeof(lpcb->request); in clp_pci_query()
521 if (lpcb->request.hdr.len != sizeof(lpcb->request) || in clp_pci_query()
522 lpcb->response.hdr.len > limit) in clp_pci_query()
524 if (lpcb->request.reserved2 != 0 || lpcb->request.reserved3 != 0) in clp_pci_query()
526 return clp_req(lpcb, CLP_LPS_PCI) ? -EOPNOTSUPP : 0; in clp_pci_query()
530 struct clp_req_rsp_query_pci_grp *lpcb) in clp_pci_query_grp() argument
532 unsigned long limit = PAGE_SIZE - sizeof(lpcb->request); in clp_pci_query_grp()
534 if (lpcb->request.hdr.len != sizeof(lpcb->request) || in clp_pci_query_grp()
535 lpcb->response.hdr.len > limit) in clp_pci_query_grp()
537 if (lpcb->request.reserved2 != 0 || lpcb->request.reserved3 != 0 || in clp_pci_query_grp()
538 lpcb->request.reserved4 != 0) in clp_pci_query_grp()
540 return clp_req(lpcb, CLP_LPS_PCI) ? -EOPNOTSUPP : 0; in clp_pci_query_grp()
543 static int clp_pci_command(struct clp_req *req, struct clp_req_hdr *lpcb) in clp_pci_command() argument
545 switch (lpcb->cmd) { in clp_pci_command()
547 return clp_pci_slpc(req, (void *) lpcb); in clp_pci_command()
549 return clp_pci_list(req, (void *) lpcb); in clp_pci_command()
551 return clp_pci_query(req, (void *) lpcb); in clp_pci_command()
553 return clp_pci_query_grp(req, (void *) lpcb); in clp_pci_command()
561 struct clp_req_hdr *lpcb; in clp_normal_command() local
570 lpcb = clp_alloc_block(GFP_KERNEL); in clp_normal_command()
571 if (!lpcb) in clp_normal_command()
576 if (copy_from_user(lpcb, uptr, PAGE_SIZE) != 0) in clp_normal_command()
580 if (lpcb->fmt != 0 || lpcb->reserved1 != 0 || lpcb->reserved2 != 0) in clp_normal_command()
585 rc = clp_base_command(req, lpcb); in clp_normal_command()
588 rc = clp_pci_command(req, lpcb); in clp_normal_command()
595 if (copy_to_user(uptr, lpcb, PAGE_SIZE) != 0) in clp_normal_command()
601 clp_free_block(lpcb); in clp_normal_command()