lpt.c (47625) | lpt.c (47640) |
---|---|
1/* 2 * Copyright (c) 1990 William F. Jolitz, TeleMuse 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 34 unchanged lines hidden (view full) --- 43 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 44 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 45 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 46 * SUCH DAMAGE. 47 * 48 * from: unknown origin, 386BSD 0.1 49 * From Id: lpt.c,v 1.55.2.1 1996/11/12 09:08:38 phk Exp 50 * From Id: nlpt.c,v 1.14 1999/02/08 13:55:43 des Exp | 1/* 2 * Copyright (c) 1990 William F. Jolitz, TeleMuse 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 34 unchanged lines hidden (view full) --- 43 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 44 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 45 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 46 * SUCH DAMAGE. 47 * 48 * from: unknown origin, 386BSD 0.1 49 * From Id: lpt.c,v 1.55.2.1 1996/11/12 09:08:38 phk Exp 50 * From Id: nlpt.c,v 1.14 1999/02/08 13:55:43 des Exp |
51 * $Id: lpt.c,v 1.3 1999/04/28 10:51:35 dt Exp $ | 51 * $Id: lpt.c,v 1.4 1999/05/30 16:51:34 phk Exp $ |
52 */ 53 54/* 55 * Device Driver for AT parallel printer port 56 * Written by William Jolitz 12/18/90 57 */ 58 59/* --- 298 unchanged lines hidden (view full) --- 358 359/* 360 * lptprobe() 361 */ 362static struct ppb_device * 363lptprobe(struct ppb_data *ppb) 364{ 365 struct lpt_data *sc; | 52 */ 53 54/* 55 * Device Driver for AT parallel printer port 56 * Written by William Jolitz 12/18/90 57 */ 58 59/* --- 298 unchanged lines hidden (view full) --- 358 359/* 360 * lptprobe() 361 */ 362static struct ppb_device * 363lptprobe(struct ppb_data *ppb) 364{ 365 struct lpt_data *sc; |
366 static int once; 367 368 if (!once++) 369 cdevsw_add(&lpt_cdevsw); |
|
366 367 sc = (struct lpt_data *) malloc(sizeof(struct lpt_data), 368 M_TEMP, M_NOWAIT); 369 if (!sc) { 370 printf(LPT_NAME ": cannot malloc!\n"); 371 return (0); 372 } 373 bzero(sc, sizeof(struct lpt_data)); --- 575 unchanged lines hidden (view full) --- 949 error = EOPNOTSUPP; 950 break; 951 default: 952 error = ENODEV; 953 } 954 955 return(error); 956} | 370 371 sc = (struct lpt_data *) malloc(sizeof(struct lpt_data), 372 M_TEMP, M_NOWAIT); 373 if (!sc) { 374 printf(LPT_NAME ": cannot malloc!\n"); 375 return (0); 376 } 377 bzero(sc, sizeof(struct lpt_data)); --- 575 unchanged lines hidden (view full) --- 953 error = EOPNOTSUPP; 954 break; 955 default: 956 error = ENODEV; 957 } 958 959 return(error); 960} |
957 958static int lpt_devsw_installed; 959 960static void 961lpt_drvinit(void *unused) 962{ 963 dev_t dev; 964 965 if( ! lpt_devsw_installed ) { 966 dev = makedev(CDEV_MAJOR, 0); 967 cdevsw_add(&dev,&lpt_cdevsw, NULL); 968 lpt_devsw_installed = 1; 969 } 970} 971 972SYSINIT(lptdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,lpt_drvinit,NULL) | |