Lines Matching refs:lpcb

451 static int clp_base_slpc(struct clp_req *req, struct clp_req_rsp_slpc *lpcb)  in clp_base_slpc()  argument
453 unsigned long limit = PAGE_SIZE - sizeof(lpcb->request); in clp_base_slpc()
455 if (lpcb->request.hdr.len != sizeof(lpcb->request) || in clp_base_slpc()
456 lpcb->response.hdr.len > limit) in clp_base_slpc()
458 return clp_req(lpcb, CLP_LPS_BASE) ? -EOPNOTSUPP : 0; in clp_base_slpc()
461 static int clp_base_command(struct clp_req *req, struct clp_req_hdr *lpcb) in clp_base_command() argument
463 switch (lpcb->cmd) { in clp_base_command()
465 return clp_base_slpc(req, (void *) lpcb); in clp_base_command()
471 static int clp_pci_slpc(struct clp_req *req, struct clp_req_rsp_slpc *lpcb) in clp_pci_slpc() argument
473 unsigned long limit = PAGE_SIZE - sizeof(lpcb->request); in clp_pci_slpc()
475 if (lpcb->request.hdr.len != sizeof(lpcb->request) || in clp_pci_slpc()
476 lpcb->response.hdr.len > limit) in clp_pci_slpc()
478 return clp_req(lpcb, CLP_LPS_PCI) ? -EOPNOTSUPP : 0; in clp_pci_slpc()
481 static int clp_pci_list(struct clp_req *req, struct clp_req_rsp_list_pci *lpcb) in clp_pci_list() argument
483 unsigned long limit = PAGE_SIZE - sizeof(lpcb->request); in clp_pci_list()
485 if (lpcb->request.hdr.len != sizeof(lpcb->request) || in clp_pci_list()
486 lpcb->response.hdr.len > limit) in clp_pci_list()
488 if (lpcb->request.reserved2 != 0) in clp_pci_list()
490 return clp_req(lpcb, CLP_LPS_PCI) ? -EOPNOTSUPP : 0; in clp_pci_list()
494 struct clp_req_rsp_query_pci *lpcb) in clp_pci_query() argument
496 unsigned long limit = PAGE_SIZE - sizeof(lpcb->request); in clp_pci_query()
498 if (lpcb->request.hdr.len != sizeof(lpcb->request) || in clp_pci_query()
499 lpcb->response.hdr.len > limit) in clp_pci_query()
501 if (lpcb->request.reserved2 != 0 || lpcb->request.reserved3 != 0) in clp_pci_query()
503 return clp_req(lpcb, CLP_LPS_PCI) ? -EOPNOTSUPP : 0; in clp_pci_query()
507 struct clp_req_rsp_query_pci_grp *lpcb) in clp_pci_query_grp() argument
509 unsigned long limit = PAGE_SIZE - sizeof(lpcb->request); in clp_pci_query_grp()
511 if (lpcb->request.hdr.len != sizeof(lpcb->request) || in clp_pci_query_grp()
512 lpcb->response.hdr.len > limit) in clp_pci_query_grp()
514 if (lpcb->request.reserved2 != 0 || lpcb->request.reserved3 != 0 || in clp_pci_query_grp()
515 lpcb->request.reserved4 != 0) in clp_pci_query_grp()
517 return clp_req(lpcb, CLP_LPS_PCI) ? -EOPNOTSUPP : 0; in clp_pci_query_grp()
520 static int clp_pci_command(struct clp_req *req, struct clp_req_hdr *lpcb) in clp_pci_command() argument
522 switch (lpcb->cmd) { in clp_pci_command()
524 return clp_pci_slpc(req, (void *) lpcb); in clp_pci_command()
526 return clp_pci_list(req, (void *) lpcb); in clp_pci_command()
528 return clp_pci_query(req, (void *) lpcb); in clp_pci_command()
530 return clp_pci_query_grp(req, (void *) lpcb); in clp_pci_command()
538 struct clp_req_hdr *lpcb; in clp_normal_command() local
547 lpcb = clp_alloc_block(GFP_KERNEL); in clp_normal_command()
548 if (!lpcb) in clp_normal_command()
553 if (copy_from_user(lpcb, uptr, PAGE_SIZE) != 0) in clp_normal_command()
557 if (lpcb->fmt != 0 || lpcb->reserved1 != 0 || lpcb->reserved2 != 0) in clp_normal_command()
562 rc = clp_base_command(req, lpcb); in clp_normal_command()
565 rc = clp_pci_command(req, lpcb); in clp_normal_command()
572 if (copy_to_user(uptr, lpcb, PAGE_SIZE) != 0) in clp_normal_command()
578 clp_free_block(lpcb); in clp_normal_command()