/** * Finish with TLS session * * @v tls TLS session * @v rc Status code */ static void tls_close ( struct tls_session *tls, int rc ) { /* Remove process */ process_del ( &tls->process ); /* Close ciphertext and plaintext streams */ intf_shutdown ( &tls->cipherstream, rc ); intf_shutdown ( &tls->plainstream, rc ); }
/** * Mark DNS request as complete * * @v dns DNS request * @v rc Return status code */ static void dns_done ( struct dns_request *dns, int rc ) { /* Stop the retry timer */ stop_timer ( &dns->timer ); /* Shut down interfaces */ intf_shutdown ( &dns->socket, rc ); intf_shutdown ( &dns->resolv, rc ); }
/** * Close Fibre Channel ELS transaction * * @v els Fibre Channel ELS transaction * @v rc Reason for close */ static void fc_els_close ( struct fc_els *els, int rc ) { if ( rc != 0 ) { DBGC ( els, FCELS_FMT " complete (%s)\n", FCELS_ARGS ( els ), strerror ( rc ) ); } /* Stop process */ process_del ( &els->process ); /* Shut down interfaces */ intf_shutdown ( &els->xchg, rc ); intf_shutdown ( &els->job, rc ); }
/** * Terminate download * * @v downloader Downloader * @v rc Reason for termination */ static void downloader_finished ( struct downloader *downloader, int rc ) { /* Log download status */ if ( rc == 0 ) { syslog ( LOG_NOTICE, "Downloaded \"%s\"\n", downloader->image->name ); } else { syslog ( LOG_ERR, "Download of \"%s\" failed: %s\n", downloader->image->name, strerror ( rc ) ); } /* Shut down interfaces */ intf_shutdown ( &downloader->xfer, rc ); intf_shutdown ( &downloader->job, rc ); }
/** * Child finished resolution * * @v mux Name resolution multiplexer * @v rc Return status code */ static void resmux_child_close ( struct resolv_mux *mux, int rc ) { /* Restart child interface */ intf_restart ( &mux->child, rc ); /* If this resolution succeeded, stop now */ if ( rc == 0 ) { DBGC ( mux, "RESOLV %p succeeded using method %s\n", mux, mux->resolver->name ); goto finished; } /* Attempt next child resolver, if possible */ mux->resolver++; if ( mux->resolver >= table_end ( RESOLVERS ) ) { DBGC ( mux, "RESOLV %p failed to resolve name\n", mux ); goto finished; } if ( ( rc = resmux_try ( mux ) ) != 0 ) goto finished; /* Next resolver is now running */ return; finished: intf_shutdown ( &mux->parent, rc ); }
/** * Transfer finished or was aborted * * @v file Data transfer file * @v rc Reason for close */ static void efi_download_close ( struct efi_download_file *file, int rc ) { file->finish_callback ( file->context, EFIRC ( rc ) ); intf_shutdown ( &file->xfer, rc ); efi_snp_release(); }
/** * Close CMRC connection * * @v cmrc Communication-Managed Reliable Connection * @v rc Reason for close */ static void ib_cmrc_close ( struct ib_cmrc_connection *cmrc, int rc ) { /* Close data transfer interface */ intf_shutdown ( &cmrc->xfer, rc ); /* Schedule shutdown process */ process_add ( &cmrc->shutdown ); }
/** * Shut down and restart an object interface * * @v intf Object interface * @v rc Reason for close * * Shuts down the interface, then unblocks operations that were * blocked during shutdown. */ void intf_restart ( struct interface *intf, int rc ) { struct interface_descriptor *desc = intf->desc; /* Shut down the interface */ intf_shutdown ( intf, rc ); DBGC ( INTF_COL ( intf ), "INTF " INTF_FMT " restarting\n", INTF_DBG ( intf ) ); /* Restore the interface descriptor. Must be done after * shutdown (rather than inhibiting intf_shutdown() from * nullifying the descriptor) in order to avoid a potential * infinite loop as the intf_close() operations on each side * of the link call each other recursively. */ intf->desc = desc; }
/** * Close Fibre Channel exchange * * @v xchg Fibre Channel exchange * @v rc Reason for close */ static void fc_xchg_close ( struct fc_exchange *xchg, int rc ) { struct fc_port *port = xchg->port; if ( rc != 0 ) { DBGC2 ( port, "FCXCHG %s/%04x closed: %s\n", port->name, xchg->xchg_id, strerror ( rc ) ); } /* Stop timer */ stop_timer ( &xchg->timer ); /* If list still holds a reference, remove from list of open * exchanges and drop list's reference. */ if ( ! list_empty ( &xchg->list ) ) { list_del ( &xchg->list ); INIT_LIST_HEAD ( &xchg->list ); ref_put ( &xchg->refcnt ); } /* Shutdown interfaces */ intf_shutdown ( &xchg->ulp, rc ); }
static void hw_finished ( struct hw *hw, int rc ) { intf_shutdown ( &hw->xfer, rc ); process_del ( &hw->process ); }
static void numeric_step ( struct numeric_resolv *numeric ) { if ( numeric->rc == 0 ) resolv_done ( &numeric->resolv, &numeric->sa ); intf_shutdown ( &numeric->resolv, numeric->rc ); }
/** * Terminate named socket opener * * @v named Named socket * @v rc Reason for termination */ static void named_close ( struct named_socket *named, int rc ) { /* Shut down interfaces */ intf_shutdown ( &named->resolv, rc ); intf_shutdown ( &named->xfer, rc ); }