'\" t .\" Title: dev_alloc_name .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: January 2017 .\" Manual: Network device support .\" Source: Kernel Hackers Manual 4.8.15 .\" Language: English .\" .TH "DEV_ALLOC_NAME" "9" "January 2017" "Kernel Hackers Manual 4\&.8\&." "Network device support" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" dev_alloc_name \- allocate a name for a device .SH "SYNOPSIS" .HP \w'int\ dev_alloc_name('u .BI "int dev_alloc_name(struct\ net_device\ *\ " "dev" ", const\ char\ *\ " "name" ");" .SH "ARGUMENTS" .PP \fIdev\fR .RS 4 device .RE .PP \fIname\fR .RS 4 name format string .RE .SH "DESCRIPTION" .PP Passed a format string \- eg \(lqlt\fBd\fR\(rq it will try and find a suitable id\&. It scans list of devices to build up a free map, then chooses the first empty slot\&. The caller must hold the dev_base or rtnl lock while allocating the name and adding the device in order to avoid duplicates\&. Limited to bits_per_byte * page size devices (ie 32K on most platforms)\&. Returns the number of the unit assigned or a negative errno code\&. .SH "COPYRIGHT" .br