| Linas Vepstas | 172ca92 | 2005-11-03 18:50:04 -0600 | [diff] [blame] | 1 | /* | 
|  | 2 | *	eeh_event.h | 
|  | 3 | * | 
|  | 4 | * This program is free software; you can redistribute it and/or modify | 
|  | 5 | * it under the terms of the GNU General Public License as published by | 
|  | 6 | * the Free Software Foundation; either version 2 of the License, or | 
|  | 7 | * (at your option) any later version. | 
|  | 8 | * | 
|  | 9 | * This program is distributed in the hope that it will be useful, | 
|  | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
|  | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
|  | 12 | * GNU General Public License for more details. | 
|  | 13 | * | 
|  | 14 | * You should have received a copy of the GNU General Public License | 
|  | 15 | * along with this program; if not, write to the Free Software | 
|  | 16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA | 
|  | 17 | * | 
|  | 18 | * Copyright (c) 2005 Linas Vepstas <linas@linas.org> | 
|  | 19 | */ | 
|  | 20 |  | 
| Linas Vepstas | ac325ac | 2006-04-18 21:05:21 -0700 | [diff] [blame] | 21 | #ifndef ASM_POWERPC_EEH_EVENT_H | 
|  | 22 | #define ASM_POWERPC_EEH_EVENT_H | 
| Arnd Bergmann | 88ced03 | 2005-12-16 22:43:46 +0100 | [diff] [blame] | 23 | #ifdef __KERNEL__ | 
| Linas Vepstas | 172ca92 | 2005-11-03 18:50:04 -0600 | [diff] [blame] | 24 |  | 
|  | 25 | /** EEH event -- structure holding pci controller data that describes | 
|  | 26 | *  a change in the isolation status of a PCI slot.  A pointer | 
|  | 27 | *  to this struct is passed as the data pointer in a notify callback. | 
|  | 28 | */ | 
|  | 29 | struct eeh_event { | 
|  | 30 | struct list_head     list; | 
|  | 31 | struct device_node 	*dn;   /* struct device node */ | 
|  | 32 | struct pci_dev       *dev;  /* affected device */ | 
| Linas Vepstas | 77bd741 | 2005-11-03 18:52:49 -0600 | [diff] [blame] | 33 | enum pci_channel_state state; /* PCI bus state for the affected device */ | 
| Linas Vepstas | 172ca92 | 2005-11-03 18:50:04 -0600 | [diff] [blame] | 34 | int time_unavail;    /* milliseconds until device might be available */ | 
|  | 35 | }; | 
|  | 36 |  | 
|  | 37 | /** | 
|  | 38 | * eeh_send_failure_event - generate a PCI error event | 
|  | 39 | * @dev pci device | 
|  | 40 | * | 
|  | 41 | * This routine builds a PCI error event which will be delivered | 
| Linas Vepstas | ac325ac | 2006-04-18 21:05:21 -0700 | [diff] [blame] | 42 | * to all listeners on the eeh_notifier_chain. | 
| Linas Vepstas | 172ca92 | 2005-11-03 18:50:04 -0600 | [diff] [blame] | 43 | * | 
|  | 44 | * This routine can be called within an interrupt context; | 
|  | 45 | * the actual event will be delivered in a normal context | 
|  | 46 | * (from a workqueue). | 
|  | 47 | */ | 
|  | 48 | int eeh_send_failure_event (struct device_node *dn, | 
|  | 49 | struct pci_dev *dev, | 
| Linas Vepstas | 77bd741 | 2005-11-03 18:52:49 -0600 | [diff] [blame] | 50 | enum pci_channel_state state, | 
| Linas Vepstas | 172ca92 | 2005-11-03 18:50:04 -0600 | [diff] [blame] | 51 | int time_unavail); | 
|  | 52 |  | 
| Linas Vepstas | 77bd741 | 2005-11-03 18:52:49 -0600 | [diff] [blame] | 53 | /* Main recovery function */ | 
| Linas Vepstas | ac325ac | 2006-04-18 21:05:21 -0700 | [diff] [blame] | 54 | struct pci_dn * handle_eeh_events (struct eeh_event *); | 
| Linas Vepstas | 77bd741 | 2005-11-03 18:52:49 -0600 | [diff] [blame] | 55 |  | 
| Arnd Bergmann | 88ced03 | 2005-12-16 22:43:46 +0100 | [diff] [blame] | 56 | #endif /* __KERNEL__ */ | 
| Linas Vepstas | ac325ac | 2006-04-18 21:05:21 -0700 | [diff] [blame] | 57 | #endif /* ASM_POWERPC_EEH_EVENT_H */ |