From: Antonio Huete Jimenez Date: Thu, 7 Feb 2013 01:07:30 +0000 (+0100) Subject: doc - Add a note about %D removal in porting_drivers.txt document. X-Git-Tag: v3.4.0rc~382 X-Git-Url: https://gitweb.dragonflybsd.org/~tuxillo/dragonfly.git/commitdiff_plain/2764c24181ac48a6c2252c8063152f7e16e7cf79 doc - Add a note about %D removal in porting_drivers.txt document. --- diff --git a/doc/porting_drivers.txt b/doc/porting_drivers.txt index 30dc9292b5..c084e73bfa 100644 --- a/doc/porting_drivers.txt +++ b/doc/porting_drivers.txt @@ -167,3 +167,25 @@ $DragonFly: doc/notes/porting_drivers.txt,v 1.4 2008/04/06 19:08:30 pavalos Exp goto retry; * MPASS macro - Replace it with KKASSERT + +* In DragonFly 3.3 format specifier %D was removed from kprintf. As a + replacement functions kether_ntoa() and hexncpy() were added. + + - Ethernet address (MAC) to its hexadecimal form: + + char ethstr[ETHER_ADDRSTRLEN + 1]; + u_char hwaddr[6]; + + kprintf("MAC address %s\n", kether_ntoa(hwaddr, ethstr) + + - Generic conversion (block of bytes to hexadecimal form): + + char hexstr[18]; + u_char mydata[6] = {1, 2, 3, 4, 5 ,6}; + + /* + * Below statement would print: + * + * 01-02-03-04-05-06 + */ + kprintf("%s\n", hexncpy(mydata, 6, hexstr, HEX_NCPYLEN(6), "-"));