1. Disconnect the negative battery cable..
2. Remove the front map light..
3. Verify that the continuity between the sunroof switch terminals is as indicated in the table.

If not as indicated in the table, replace the sunroof switch.

Sunroof Switch Removal/InstallationFuel and Engine Exhaust Precautions
Fuel Requirements
Vehicles with catalytic converters or oxygen sensors must use ONLY UNLEADED FUEL,
which will reduce exhaust emissions and keep spark plug fouling to a minimum.
Your Mazda will perform best with fuel listed in the table.
Fuel with a rating lower than 87 octane (91 RON) could ...
Front Body Straight Line Dimensions (2) [Dimensions]
Point symbol
Designation
Hole diameter or bolt or nut size mm {in}
A
Roof seamless location
-
B
Cabin side outer frame (front pillar outer) projection location
-
...
Keyless Antenna [Keyless Entry System]
Purpose
Outputs a request signal and specifies the remote transmitter location.
Function
The keyless antennas output request signals based on the signals from the
start stop unit.
Construction, Operation
Request signals are output by the keyless antenna installed ...