| 224 | } |
| 225 | |
| 226 | static 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 | |
| 249 | void rt_pci_set_master(struct rt_pci_device *pdev) |
| 250 | { |
no test coverage detected