The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/ipsc/dev_forward_name.c

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /* 
    2  * Mach Operating System
    3  * Copyright (c) 1991 Carnegie Mellon University
    4  * All Rights Reserved.
    5  * 
    6  * Permission to use, copy, modify and distribute this software and its
    7  * documentation is hereby granted, provided that both the copyright
    8  * notice and this permission notice appear in all copies of the
    9  * software, derivative works or modified versions, and any portions
   10  * thereof, and that both notices appear in supporting documentation.
   11  * 
   12  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
   13  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
   14  * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
   15  * 
   16  * Carnegie Mellon requests users of this software to return to
   17  * 
   18  *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
   19  *  School of Computer Science
   20  *  Carnegie Mellon University
   21  *  Pittsburgh PA 15213-3890
   22  * 
   23  * any improvements or extensions that they make and grant Carnegie Mellon
   24  * the rights to redistribute these changes.
   25  */
   26 /*
   27  * Copyright 1988, 1989, 1990, 1991 by Intel Corporation,
   28  * Santa Clara, California.
   29  * 
   30  *                          All Rights Reserved
   31  * 
   32  * Permission to use, copy, modify, and distribute this software and its
   33  * documentation for any purpose and without fee is hereby granted,
   34  * provided that the above copyright notice appears in all copies and that
   35  * both the copyright notice and this permission notice appear in
   36  * supporting documentation, and that the name of Intel not be used in
   37  * advertising or publicity pertaining to distribution of the software
   38  * without specific, written prior permission.
   39  * 
   40  * INTEL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING
   41  * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT
   42  * SHALL INTEL BE LIABLE FOR ANY SPECIAL, INDIRECT, OR CONSEQUENTIAL
   43  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
   44  * PROFITS, WHETHER IN ACTION OF CONTRACT, NEGLIGENCE, OR OTHER TORTIOUS
   45  * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
   46  * THIS SOFTWARE.
   47  */
   48 /*
   49  * HISTORY
   50  * $Log:        dev_forward_name.c,v $
   51  * Revision 2.7  91/12/10  16:32:30  jsb
   52  *      Fixes from Intel
   53  *      [91/12/10  15:33:38  jsb]
   54  * 
   55  * Revision 2.6  91/08/03  18:18:42  jsb
   56  *      Removed norma conditionals; use conf/file technology instead.
   57  *      [91/07/27  18:16:09  jsb]
   58  * 
   59  * Revision 2.5  91/06/18  20:52:48  jsb
   60  *      New copyright from Intel.
   61  *      [91/06/18  19:05:03  jsb]
   62  * 
   63  * Revision 2.4  91/06/17  15:46:43  jsb
   64  *      Renamed NORMA conditionals. Modified for non-integrated I/O nodes.
   65  *      [91/06/17  13:48:13  jsb]
   66  * 
   67  * Revision 2.3  91/06/06  17:06:32  jsb
   68  *      Add entries to compensate for ux's generation of names like sd0i
   69  *      when it should be generating names like sd1a.
   70  *      (This is a stopgap, not a real fix.)
   71  *      [91/05/13  17:29:24  jsb]
   72  * 
   73  * Revision 2.2.1.1  90/12/17  23:09:42  jsb
   74  *      Add entries to compensate for ux's generation of names like sd0i
   75  *      when it should be generating names like sd1a.
   76  *      (This is a stopgap, not a real fix.)
   77  * 
   78  * Revision 2.2  90/12/14  11:01:43  jsb
   79  *      First checkin.
   80  *      [90/12/14  09:37:57  jsb]
   81  * 
   82  */
   83 
   84 struct dev_forward_entry {
   85         char *  global_name;
   86         char *  local_name;
   87 } dev_forward_table[] = {
   88         "sd0a",         "<130>sd0a",
   89         "sd0b",         "<130>sd0b",
   90         "sd0c",         "<130>sd0c",
   91         "sd0d",         "<130>sd0d",
   92         "sd0e",         "<130>sd0e",
   93         "sd0f",         "<130>sd0f",
   94         "sd0g",         "<130>sd0g",
   95         "sd0h",         "<130>sd0h",
   96 
   97         "sd0i",         "<130>sd0a",
   98         "sd0j",         "<130>sd0b",
   99         "sd0k",         "<130>sd0c",
  100         "sd0l",         "<130>sd0d",
  101         "sd0m",         "<130>sd0e",
  102         "sd0n",         "<130>sd0f",
  103         "sd0o",         "<130>sd0g",
  104         "sd0p",         "<130>sd0h",
  105 
  106         "sd1a",         "<130>sd0a",
  107         "sd1b",         "<130>sd0b",
  108         "sd1c",         "<130>sd0c",
  109         "sd1d",         "<130>sd0d",
  110         "sd1e",         "<130>sd0e",
  111         "sd1f",         "<130>sd0f",
  112         "sd1g",         "<130>sd0g",
  113         "sd1h",         "<130>sd0h",
  114 
  115         "md0a",         "<131>md0a",
  116 
  117         "cnp0",         "<131>cnp0",
  118 
  119         0,              0,
  120 };
  121 
  122 char *
  123 dev_forward_name(name, namebuf, namelen)
  124         char *name;
  125         char *namebuf;
  126         int namelen;
  127 {
  128         struct dev_forward_entry *dfe;
  129         
  130         for (dfe = &dev_forward_table[0]; dfe->global_name; dfe++) {
  131                 if (! strcmp(name, dfe->global_name)) {
  132                         strncpy(namebuf, dfe->local_name, namelen);
  133                         return namebuf;
  134                 }
  135         }
  136         return name;
  137 }

Cache object: 1e10d007834a362fb5f63a16205cba4a


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.