@@ -84,34 +84,34 @@ impl MsiCapability {
84
84
}
85
85
86
86
/// Is MSI capability enabled?
87
- pub fn is_enabled < T : ConfigRegionAccess > ( & self , access : & T ) -> bool {
87
+ pub fn is_enabled ( & self , access : & impl ConfigRegionAccess ) -> bool {
88
88
let reg = unsafe { access. read ( self . address . address , self . address . offset ) } ;
89
89
reg. get_bit ( 0 )
90
90
}
91
91
92
92
/// Enable or disable MSI capability
93
- pub fn set_enabled < T : ConfigRegionAccess > ( & self , enabled : bool , access : & T ) {
93
+ pub fn set_enabled ( & self , enabled : bool , access : & impl ConfigRegionAccess ) {
94
94
let mut reg = unsafe { access. read ( self . address . address , self . address . offset ) } ;
95
95
reg. set_bit ( 0 , enabled) ;
96
96
unsafe { access. write ( self . address . address , self . address . offset , reg) } ;
97
97
}
98
98
99
99
/// Set how much interrupts the device will use. If requested count is bigger than supported count,
100
100
/// the second will be used.
101
- pub fn set_multiple_message_enable < T : ConfigRegionAccess > (
101
+ pub fn set_multiple_message_enable (
102
102
& self ,
103
103
data : MultipleMessageSupport ,
104
- access : & T ,
104
+ access : & impl ConfigRegionAccess ,
105
105
) {
106
106
let mut reg = unsafe { access. read ( self . address . address , self . address . offset ) } ;
107
107
reg. set_bits ( 4 ..7 , ( data. min ( self . multiple_message_capable ) ) as u32 ) ;
108
108
unsafe { access. write ( self . address . address , self . address . offset , reg) } ;
109
109
}
110
110
111
111
/// Return how much interrupts the device is using
112
- pub fn get_multiple_message_enable < T : ConfigRegionAccess > (
112
+ pub fn get_multiple_message_enable (
113
113
& self ,
114
- access : & T ,
114
+ access : & impl ConfigRegionAccess ,
115
115
) -> MultipleMessageSupport {
116
116
let reg = unsafe { access. read ( self . address . address , self . address . offset ) } ;
117
117
MultipleMessageSupport :: try_from ( reg. get_bits ( 4 ..7 ) as u8 )
@@ -125,12 +125,12 @@ impl MsiCapability {
125
125
/// * `vector` - Which interrupt vector should be triggered on LAPIC
126
126
/// * `trigger_mode` - When interrupt should be triggered
127
127
/// * `access` - PCI Configuration Space accessor
128
- pub fn set_message_info < T : ConfigRegionAccess > (
128
+ pub fn set_message_info (
129
129
& self ,
130
130
address : u32 ,
131
131
vector : u8 ,
132
132
trigger_mode : TriggerMode ,
133
- access : & T ,
133
+ access : & impl ConfigRegionAccess ,
134
134
) {
135
135
unsafe { access. write ( self . address . address , self . address . offset + 0x4 , address) }
136
136
let data_offset = if self . is_64bit { 0xC } else { 0x8 } ;
@@ -152,7 +152,7 @@ impl MsiCapability {
152
152
/// # Note
153
153
/// Only supported on when device supports 64-bit addressing and per-vector masking. Otherwise
154
154
/// returns `0`
155
- pub fn get_message_mask < T : ConfigRegionAccess > ( & self , access : & T ) -> u32 {
155
+ pub fn get_message_mask ( & self , access : & impl ConfigRegionAccess ) -> u32 {
156
156
if self . is_64bit && self . per_vector_masking {
157
157
unsafe { access. read ( self . address . address , self . address . offset + 0x10 ) }
158
158
} else {
@@ -165,7 +165,7 @@ impl MsiCapability {
165
165
/// # Note
166
166
/// Only supported on when device supports 64-bit addressing and per-vector masking. Otherwise
167
167
/// will do nothing
168
- pub fn set_message_mask < T : ConfigRegionAccess > ( & self , access : & T , mask : u32 ) {
168
+ pub fn set_message_mask ( & self , access : & impl ConfigRegionAccess , mask : u32 ) {
169
169
if self . is_64bit && self . per_vector_masking {
170
170
unsafe { access. write ( self . address . address , self . address . offset + 0x10 , mask) }
171
171
}
@@ -175,7 +175,7 @@ impl MsiCapability {
175
175
///
176
176
/// # Note
177
177
/// Only supported on when device supports 64-bit addressing. Otherwise will return `0`
178
- pub fn get_pending < T : ConfigRegionAccess > ( & self , access : & T ) -> u32 {
178
+ pub fn get_pending ( & self , access : & impl ConfigRegionAccess ) -> u32 {
179
179
if self . is_64bit {
180
180
unsafe { access. read ( self . address . address , self . address . offset + 0x14 ) }
181
181
} else {
0 commit comments