ida_pci.c (55d782fcc3998b9f4cf4335172f368316ac3e571) ida_pci.c (ed34d0ade2848f88c70b745d77380c5069ebdfd6)
1/*-
2 * Copyright (c) 1999,2000 Jonathan Lemon
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

--- 267 unchanged lines hidden (view full) ---

276 rid = 0;
277 ida->irq_res_type = SYS_RES_IRQ;
278 ida->irq = bus_alloc_resource(dev, ida->irq_res_type, &rid,
279 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE);
280 if (ida->irq == NULL) {
281 ida_free(ida);
282 return (ENOMEM);
283 }
1/*-
2 * Copyright (c) 1999,2000 Jonathan Lemon
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

--- 267 unchanged lines hidden (view full) ---

276 rid = 0;
277 ida->irq_res_type = SYS_RES_IRQ;
278 ida->irq = bus_alloc_resource(dev, ida->irq_res_type, &rid,
279 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE);
280 if (ida->irq == NULL) {
281 ida_free(ida);
282 return (ENOMEM);
283 }
284 error = bus_setup_intr(dev, ida->irq, INTR_TYPE_BIO,
284 error = bus_setup_intr(dev, ida->irq, INTR_TYPE_BIO | INTR_ENTROPY,
285 ida_intr, ida, &ida->ih);
286 if (error) {
287 device_printf(dev, "can't setup interrupt\n");
288 ida_free(ida);
289 return (ENOMEM);
290 }
291
292 error = ida_init(ida);
293 if (error) {
294 ida_free(ida);
295 return (error);
296 }
297 ida_attach(ida);
298 ida->flags |= IDA_ATTACHED;
299
300 return (0);
301}
302
303DRIVER_MODULE(ida, pci, ida_pci_driver, ida_devclass, 0, 0);
285 ida_intr, ida, &ida->ih);
286 if (error) {
287 device_printf(dev, "can't setup interrupt\n");
288 ida_free(ida);
289 return (ENOMEM);
290 }
291
292 error = ida_init(ida);
293 if (error) {
294 ida_free(ida);
295 return (error);
296 }
297 ida_attach(ida);
298 ida->flags |= IDA_ATTACHED;
299
300 return (0);
301}
302
303DRIVER_MODULE(ida, pci, ida_pci_driver, ida_devclass, 0, 0);