MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / pci_set_master

Function pci_set_master

components/drivers/pci/pci.c:226–247  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

224}
225
226static void pci_set_master(struct rt_pci_device *pdev, rt_bool_t enable)
227{
228 rt_uint16_t old_cmd, cmd;
229
230 rt_pci_read_config_u16(pdev, PCIR_COMMAND, &old_cmd);
231
232 if (enable)
233 {
234 cmd = old_cmd | PCIM_CMD_BUSMASTEREN;
235 }
236 else
237 {
238 cmd = old_cmd & ~PCIM_CMD_BUSMASTEREN;
239 }
240
241 if (cmd != old_cmd)
242 {
243 rt_pci_write_config_u16(pdev, PCIR_COMMAND, cmd);
244 }
245
246 pdev->busmaster = !!enable;
247}
248
249void rt_pci_set_master(struct rt_pci_device *pdev)
250{

Callers 2

rt_pci_set_masterFunction · 0.85
rt_pci_clear_masterFunction · 0.85

Calls 2

rt_pci_read_config_u16Function · 0.85
rt_pci_write_config_u16Function · 0.85

Tested by

no test coverage detected