Home | History | Annotate | Line # | Download | only in lcboot
conf.c revision 1.1.2.2
      1  1.1.2.1  skrll /* $NetBSD: conf.c,v 1.1.2.2 2004/09/18 14:34:58 skrll Exp $ */
      2      1.1    igy 
      3      1.1    igy /*
      4  1.1.2.1  skrll  * Copyright (c) 2003 Naoto Shimazaki.
      5      1.1    igy  * All rights reserved.
      6      1.1    igy  *
      7      1.1    igy  * Redistribution and use in source and binary forms, with or without
      8      1.1    igy  * modification, are permitted provided that the following conditions
      9      1.1    igy  * are met:
     10      1.1    igy  * 1. Redistributions of source code must retain the above copyright
     11      1.1    igy  *    notice, this list of conditions and the following disclaimer.
     12      1.1    igy  * 2. Redistributions in binary form must reproduce the above copyright
     13      1.1    igy  *    notice, this list of conditions and the following disclaimer in the
     14      1.1    igy  *    documentation and/or other materials provided with the distribution.
     15      1.1    igy  *
     16  1.1.2.1  skrll  * THIS SOFTWARE IS PROVIDED BY NAOTO SHIMAZAKI AND CONTRIBUTORS ``AS IS''
     17  1.1.2.1  skrll  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
     18  1.1.2.1  skrll  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     19  1.1.2.1  skrll  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE NAOTO OR CONTRIBUTORS BE
     20  1.1.2.1  skrll  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     21      1.1    igy  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     22      1.1    igy  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     23      1.1    igy  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     24      1.1    igy  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     25  1.1.2.1  skrll  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
     26  1.1.2.1  skrll  * THE POSSIBILITY OF SUCH DAMAGE.
     27      1.1    igy  */
     28      1.1    igy #include <sys/cdefs.h>
     29  1.1.2.1  skrll __KERNEL_RCSID(0, "$NetBSD: conf.c,v 1.1.2.2 2004/09/18 14:34:58 skrll Exp $");
     30  1.1.2.1  skrll 
     31  1.1.2.1  skrll #include <netinet/in.h>
     32      1.1    igy 
     33      1.1    igy #include <lib/libsa/stand.h>
     34  1.1.2.1  skrll #include <lib/libsa/netif.h>
     35      1.1    igy #include <lib/libsa/tftp.h>
     36      1.1    igy 
     37      1.1    igy #include "extern.h"
     38      1.1    igy 
     39      1.1    igy struct devsw	devsw[] = {
     40      1.1    igy 	{
     41      1.1    igy 		.dv_name	= "flash",
     42      1.1    igy 		.dv_strategy	= flash_strategy,
     43      1.1    igy 		.dv_open	= flash_open,
     44      1.1    igy 		.dv_close	= flash_close,
     45      1.1    igy 		.dv_ioctl	= flash_ioctl,
     46      1.1    igy 	},
     47  1.1.2.1  skrll 	{
     48  1.1.2.1  skrll 		.dv_name	= "net",
     49  1.1.2.1  skrll 		.dv_strategy	= net_strategy,
     50  1.1.2.1  skrll 		.dv_open	= net_open,
     51  1.1.2.1  skrll 		.dv_close	= net_close,
     52  1.1.2.1  skrll 		.dv_ioctl	= net_ioctl,
     53  1.1.2.1  skrll 	},
     54      1.1    igy };
     55      1.1    igy int	ndevs = sizeof devsw / sizeof devsw[0];
     56      1.1    igy 
     57  1.1.2.1  skrll struct fs_ops	file_system[] = {
     58  1.1.2.1  skrll 	{
     59  1.1.2.1  skrll 		.open		= tftp_open,
     60  1.1.2.1  skrll 		.close		= tftp_close,
     61  1.1.2.1  skrll 		.read		= tftp_read,
     62  1.1.2.1  skrll 		.write		= tftp_write,
     63  1.1.2.1  skrll 		.seek		= tftp_seek,
     64  1.1.2.1  skrll 		.stat		= tftp_stat,
     65  1.1.2.1  skrll 	}
     66  1.1.2.1  skrll };
     67  1.1.2.1  skrll int	nfsys = sizeof file_system / sizeof file_system[0];
     68  1.1.2.1  skrll 
     69  1.1.2.1  skrll struct netif_driver	*netif_drivers[] = {
     70  1.1.2.1  skrll 	&cs_driver,
     71  1.1.2.1  skrll };
     72  1.1.2.1  skrll int n_netif_drivers = sizeof netif_drivers / sizeof netif_drivers[0];
     73