Lines Matching refs:controller
319 agp_controller *controller; in agp_find_controller_by_pid() local
321 controller = agp_fe.controllers; in agp_find_controller_by_pid()
323 while (controller != NULL) { in agp_find_controller_by_pid()
324 if (controller->pid == id) { in agp_find_controller_by_pid()
325 return controller; in agp_find_controller_by_pid()
327 controller = controller->next; in agp_find_controller_by_pid()
335 agp_controller *controller; in agp_create_controller() local
337 controller = kmalloc(sizeof(agp_controller), GFP_KERNEL); in agp_create_controller()
339 if (controller == NULL) { in agp_create_controller()
342 memset(controller, 0, sizeof(agp_controller)); in agp_create_controller()
343 controller->pid = id; in agp_create_controller()
345 return controller; in agp_create_controller()
348 static int agp_insert_controller(agp_controller * controller) in agp_insert_controller() argument
353 controller->next = prev_controller; in agp_insert_controller()
356 prev_controller->prev = controller; in agp_insert_controller()
358 agp_fe.controllers = controller; in agp_insert_controller()
363 static void agp_remove_all_clients(agp_controller * controller) in agp_remove_all_clients() argument
368 client = controller->clients; in agp_remove_all_clients()
386 static void agp_remove_all_memory(agp_controller * controller) in agp_remove_all_memory() argument
391 memory = controller->pool; in agp_remove_all_memory()
400 static int agp_remove_controller(agp_controller * controller) in agp_remove_controller() argument
405 prev_controller = controller->prev; in agp_remove_controller()
406 next_controller = controller->next; in agp_remove_controller()
420 agp_remove_all_memory(controller); in agp_remove_controller()
421 agp_remove_all_clients(controller); in agp_remove_controller()
423 if (agp_fe.current_controller == controller) { in agp_remove_controller()
428 kfree(controller); in agp_remove_controller()
432 static void agp_controller_make_current(agp_controller * controller) in agp_controller_make_current() argument
436 clients = controller->clients; in agp_controller_make_current()
450 agp_fe.current_controller = controller; in agp_controller_make_current()
453 static void agp_controller_release_current(agp_controller * controller, in agp_controller_release_current() argument
459 clients = controller->clients; in agp_controller_release_current()
482 static agp_client *agp_find_client_in_controller(agp_controller * controller, in agp_find_client_in_controller() argument
487 if (controller == NULL) { in agp_find_client_in_controller()
490 client = controller->clients; in agp_find_client_in_controller()
504 agp_controller *controller; in agp_find_controller_for_client() local
506 controller = agp_fe.controllers; in agp_find_controller_for_client()
508 while (controller != NULL) { in agp_find_controller_for_client()
509 if ((agp_find_client_in_controller(controller, id)) != NULL) { in agp_find_controller_for_client()
510 return controller; in agp_find_controller_for_client()
512 controller = controller->next; in agp_find_controller_for_client()
563 agp_controller *controller; in agp_remove_client() local
565 controller = agp_find_controller_for_client(id); in agp_remove_client()
567 if (controller == NULL) { in agp_remove_client()
570 client = agp_find_client_in_controller(controller, id); in agp_remove_client()
587 controller->clients = next_client; in agp_remove_client()
590 controller->num_clients--; in agp_remove_client()
687 agp_controller *controller; in agp_release() local
689 controller = agp_find_controller_by_pid(priv->my_pid); in agp_release()
691 if (controller != NULL) { in agp_release()
692 if (controller == agp_fe.current_controller) { in agp_release()
693 agp_controller_release_current(controller, in agp_release()
696 agp_remove_controller(controller); in agp_release()
789 agp_controller *controller; in agpioc_acquire_wrap() local
802 controller = agp_find_controller_by_pid(priv->my_pid); in agpioc_acquire_wrap()
804 if (controller != NULL) { in agpioc_acquire_wrap()
805 agp_controller_make_current(controller); in agpioc_acquire_wrap()
807 controller = agp_create_controller(priv->my_pid); in agpioc_acquire_wrap()
809 if (controller == NULL) { in agpioc_acquire_wrap()
814 agp_insert_controller(controller); in agpioc_acquire_wrap()
815 agp_controller_make_current(controller); in agpioc_acquire_wrap()