From: Stefan Richter <stefanr@s5r6.in-berlin.de>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: linux-kernel@vger.kernel.org, linux1394-devel@lists.sourceforge.net
Subject: Re: [RFC 2/4] firewire: dynamic cdev allocation below firewire major
Date: Sun, 05 Feb 2006 14:11:10 +0100 [thread overview]
Message-ID: <43E5F96E.6020605@s5r6.in-berlin.de> (raw)
In-Reply-To: <1138920012.3621.19.camel@localhost>
Johannes Berg wrote:
> This patch implements dynamic minor number allocation below the 171
> major allocated for ieee1394. Since on today's systems one doesn't need
> to have fixed device numbers any more we could just use any, but it's
> probably still useful to use the ieee1394 major number for any firewire
> related devices (like mem1394).
[...]
> --- a/drivers/ieee1394/ieee1394_core.h
> +++ b/drivers/ieee1394/ieee1394_core.h
> @@ -186,19 +186,38 @@ void hpsb_packet_received(struct hpsb_ho
> * 171:0-255, the various drivers must then cdev_add() their cdev
> * objects to handle their respective sub-regions.
> *
> + * Alternatively, drivers may use a dynamic minor number character
> + * device by using the functions hpsb_cdev_add and hpsb_cdev_del.
> + * hpsb_cdev_add requires an initialised struct cdev and will add
> + * it with cdev_add() automatically, reserving a new minor number
> + * for the new device (unless cdev_add() fails). It returns the
> + * status of cdev_add(), or -ENODEV if no minor could be allocated.
This comment should be moved to the implementations of respective
functions and be formatted as described by
Documentation/kernel-doc-nano-HOWTO.txt. (We should eventually check all
exported ieee1394 symbols if they are documented that way.)
> + * Currently 64 minor numbers are reserved for that, if necessary
> + * this number can be increased by simply adjusting the constant
> + * IEEE1394_MINOR_DYNAMIC_FIRST.
> + *
> * Minor device number block allocations:
> *
> * Block 0 ( 0- 15) raw1394
> * Block 1 ( 16- 31) video1394
> * Block 2 ( 32- 47) dv1394
> *
> - * Blocks 3-14 free for future allocation
> + * Blocks 3-10 free for future allocation
> *
> + * Block 11 (176-191) dynamic allocation region
> + * Block 12 (192-207) dynamic allocation region
> + * Block 13 (208-223) dynamic allocation region
> + * Block 14 (224-239) dynamic allocation region
> * Block 15 (240-255) reserved for drivers under development, etc.
> */
>
> #define IEEE1394_MAJOR 171
>
> +#define IEEE1394_MINOR_DYNAMIC_FIRST 176
> +#define IEEE1394_MINOR_DYNAMIC_LAST 239
> +#define IEEE1394_MINOR_DYNAMIC_COUNT (IEEE1394_MINOR_DYNAMIC_LAST-IEEE1394_MINOR_DYNAMIC_FIRST+1)
> +
> #define IEEE1394_MINOR_BLOCK_RAW1394 0
> #define IEEE1394_MINOR_BLOCK_VIDEO1394 1
> #define IEEE1394_MINOR_BLOCK_DV1394 2
> @@ -218,6 +237,11 @@ static inline unsigned char ieee1394_fil
> return file->f_dentry->d_inode->i_cindex;
> }
>
> +/* add a dynamic ieee1394 device */
> +int hpsb_cdev_add(struct cdev *chardev);
> +/* remove a dynamic ieee1394 device */
> +void hpsb_cdev_del(struct cdev *chardev);
[...]
Again, better no comment here than these two which are not very
enlightening.
--
Stefan Richter
-=====-=-==- --=- --=-=
http://arcgraph.de/sr/
next prev parent reply other threads:[~2006-02-05 13:15 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-02 22:27 [RFC 0/4] firewire: interface to remote memory (mem1394) Johannes Berg
2006-02-02 22:38 ` [RFC 1/4] firewire: node interface Johannes Berg
2006-02-02 22:40 ` [RFC 2/4] firewire: dynamic cdev allocation below firewire major Johannes Berg
2006-02-05 13:11 ` Stefan Richter [this message]
2006-02-13 3:51 ` Jody McIntyre
2006-02-13 7:32 ` Arjan van de Ven
2006-02-13 12:02 ` Johannes Berg
2006-02-13 16:49 ` Stefan Richter
2006-02-13 21:10 ` Arjan van de Ven
2006-02-14 15:41 ` Johannes Berg
2006-02-02 22:41 ` [RFC 3/4] firewire: unconditionally export hpsb_send_packet_and_wait Johannes Berg
2006-02-05 13:42 ` Stefan Richter
2006-02-07 10:45 ` Johannes Berg
2006-02-02 22:43 ` [RFC 4/4] firewire: add mem1394 Johannes Berg
2006-02-03 11:35 ` Andy Wingo
2006-02-03 11:47 ` Johannes Berg
2006-02-05 12:59 ` Stefan Richter
2006-02-05 8:43 ` Andrew Morton
2006-02-05 9:09 ` Kyle Moffett
[not found] ` <43E5D599.5040503@s5r6.in-berlin.de>
2006-02-05 20:09 ` Stefan Richter
2006-02-05 20:17 ` Andi Kleen
2006-02-05 20:50 ` Stefan Richter
2006-02-06 8:44 ` Andi Kleen
2006-02-05 14:19 ` Stefan Richter
2006-02-07 10:41 ` Johannes Berg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=43E5F96E.6020605@s5r6.in-berlin.de \
--to=stefanr@s5r6.in-berlin.de \
--cc=johannes@sipsolutions.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux1394-devel@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®